You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we talk about the problem of passing an empty array, then in #54 and #56 I processed this case and threw an exception. However, now I think that perhaps this is not quite the right approach and we should give the user the opportunity to create instances of the class from an empty array.
The text was updated successfully, but these errors were encountered:
After testing with valgrind, I identified that the error occurred when calling the destructor. It appears that PHP calls the destructor before dealing with __construct method exceptions. The destructor was trying to free an NDArray that did not exist.
The constructor is already supporting an empty array now, but I found that the __toString method and print_r are not able to handle empty arrays. I will correct this in another MR.
When running the following code:
I expect to receive:
Instead I get a segmentation fault:
The same problem occurs if I try to pass an empty array or invalid value:
If we talk about the problem of passing an empty array, then in #54 and #56 I processed this case and threw an exception. However, now I think that perhaps this is not quite the right approach and we should give the user the opportunity to create instances of the class from an empty array.
The text was updated successfully, but these errors were encountered: