17

All request and dumps in laravel add a ^before a result, that's only do that in dd or dump

exemple of error

exemple dd Request:all()

This effect generate a lot of errors on my code, someone past some like that?

6
  • I do not have it.
    – Andy Song
    Dec 2, 2019 at 20:53
  • i think is a configuration on laravel, i have another project in same server that not show that Dec 2, 2019 at 20:57
  • Do a search on your project, you may have hardcoded that character somewhere. Most IDEs have that function (Find on Path... on phpstorm) Dec 3, 2019 at 0:30
  • 1
    Can relate. Same thing happened yesterday after updating to Laravel 6.2
    – z0mbieKale
    Dec 3, 2019 at 8:54
  • 1
    Why would this generate errors in your code? dd and dump are debugging tools, they should not be used in production code.
    – Stratadox
    Dec 13, 2019 at 15:30

2 Answers 2

14

I had the same problem with laravel framework Lumen (5.8.12) and I solved the problem by returning to version 5.8.4.

The Origin of the problem seems to be the Symfony VarDumper Component (\vendor\symfony\var-dumper\Cloner\Data.php, line 302):

$dumper->dumpScalar($cursor, 'default', '^');

Should be:

 $dumper->dumpScalar($cursor, 'default', '');

Update

It is there for a useful reason. In terminal if you hover over the mouse on that ^ sign it will show you the file path from where this dump is coming from! I think it's really a useful thing but I don't see it working in browser. So, it should either be removed from borwser or fix the issue there.

1
-1

For simple variables, reading the output should be straightforward. Here are some examples showing first a variable defined in PHP, then its dump representation: Check This Link For Better reference

For example:

 $var = [
'a simple string' => "in an array of 5 elements",
'a float' => 1.0,
'an integer' => 1,
'a boolean' => true,
'an empty array' => [],
 ];
 dump($var);

The gray arrow is a toggle button for hiding/showing children of nested structures.

$var = "This is a multi-line string.\n";
$var .= "Hovering a string shows its length.\n";
$var .= "The length of UTF-8 strings is counted in terms of UTF-8 characters.\n";
$var .= "Non-UTF-8 strings length are counted in octet size.\n";
$var .= "Because of this `\xE9` octet (\\xE9),\n";
$var .= "this string is not UTF-8 valid, thus the `b` prefix.\n";
dump($var);

class PropertyExample
{
public $publicProperty = 'The `+` prefix denotes public properties,';
protected $protectedProperty = '`#` protected ones and `-` private ones.';
private $privateProperty = 'Hovering a property shows a reminder.';
}

$var = new PropertyExample();
dump($var);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.