Skip to content

Instantly share code, notes, and snippets.

@thomaslorentsen
Created September 28, 2016 15:04
Show Gist options
  • Save thomaslorentsen/670ea408172b54348913924d7fb9a063 to your computer and use it in GitHub Desktop.
Save thomaslorentsen/670ea408172b54348913924d7fb9a063 to your computer and use it in GitHub Desktop.
Replicates the cannot access variable error
<?php
class Foo {
function __construct() {
$foo = "\0";
$this->{$foo} = 'hello';
}
}
$f = new Foo();
echo var_dump($f);
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment