3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); // so only PHP 7 will show up class FooBar { private $x; public function __construct() { var_dump($this); echo "Let's remove a property!", PHP_EOL; unset($this->x); var_dump($this); echo "Let's add a property!", PHP_EOL; $this->x = 2; var_dump($this); echo "Where did the private come from?", PHP_EOL; } } $foobar = new Foobar;
based on MeWv3
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/isr4h
function name:  (null)
number of ops:  5
compiled vars:  !0 = $foobar
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   5     0  E >   NOP                                                      
  25     1        NEW                                              $2      :-5
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $2
         4      > RETURN                                                   1

Class FooBar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/isr4h
function name:  __construct
number of ops:  22
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   9     0  E >   INIT_FCALL                                               'var_dump'
         1        FETCH_THIS                                       $0      
         2        SEND_VAR                                                 $0
         3        DO_ICALL                                                 
  11     4        ECHO                                                     'Let%27s+remove+a+property%21'
         5        ECHO                                                     '%0A'
  13     6        UNSET_OBJ                                                'x'
  14     7        INIT_FCALL                                               'var_dump'
         8        FETCH_THIS                                       $2      
         9        SEND_VAR                                                 $2
        10        DO_ICALL                                                 
  16    11        ECHO                                                     'Let%27s+add+a+property%21'
        12        ECHO                                                     '%0A'
  18    13        ASSIGN_OBJ                                               'x'
        14        OP_DATA                                                  2
  19    15        INIT_FCALL                                               'var_dump'
        16        FETCH_THIS                                       $5      
        17        SEND_VAR                                                 $5
        18        DO_ICALL                                                 
  21    19        ECHO                                                     'Where+did+the+private+come+from%3F'
        20        ECHO                                                     '%0A'
  22    21      > RETURN                                                   null

End of function __construct

End of class FooBar.

Generated using Vulcan Logic Dumper, using php 7.3.0