Closed elvispt closed 2 years ago
That would probably be because of this line:
https://github.com/spatie/ray/blob/fa2b3e64a93717ccf478a701048181a515eef2a3/src/Ray.php#L639
And due to the fact that it will call a callable (which date is), according to the documentation:
ray($callable)->catch([$callable, $classname, …]) | Handle any exceptions encountered by try
@kemp I do believe this is unexpected behavior. I came across this when I was dumping the value that was on an array: ray($arr['level1']['level2'])
and was confused when ray was showing false, when I expected the value to be a string from a predefined list. I thought my code had a bug.
This is already fixed and released: https://github.com/spatie/ray/commit/41412bca9add3374a13310f6e5ceef54633f6bfd You are using 1.19.0 while the latest release is 1.33.2, the issue should be fixed after upgrading.
Sending 'date' as string and array both seem to work fine on the latest release.
Hi @Nielsvanpach I checked if I have the latest version on the app, and it says I have the latest v1.19.0.
I went to the purchases page to download, and it gives me the same version. Can you tell me where to get the latest? It's the Apple Intel version.
Thanks
Which version of spatie/ray are you using in your project? I suggest updating this with composer, not the Ray desktop app.
Oh so you mean the version at the package level. I am using the version available at WordPress Packagist (https://wordpress.org/plugins/spatie-ray/). There it's on 1.5.1.
Describe the bug When dumping the string "date"
ray('date')
the ray application shows false.If I set
exit
right after the ray function call, I also get this error on the page:Warning: date() expects parameter 1 to be string, object given in /var/www/html/app/plugins/spatie-ray/vendor/spatie/ray/src/Ray.php on line 455
It's clear it's attempting to run the date function, but it should just show the "date" string.
Versions Ray version (you can see this in "About Ray"): 1.19.0
You can use
composer show
to get the version numbers of:PHP version: 7.4.26 Laravel version (if applicable):
To Reproduce Steps to reproduce the behavior:
ray('date')
Expected behavior Should just dump the string "date" on the application.
Screenshots If applicable, add screenshots to help explain your problem. Example:
Desktop (please complete the following information):
Version: 12.1
Additional context The PHP code is running inside a docker container using
alpine:3.13.5
as base image (from which PHP is then installed).