3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __get( $property ) { if ( 'bla' === $property ) { echo 'Initializing Text->bla' . PHP_EOL; $this->bla = 'Value'; return $this->bla; } $message = sprintf( 'Undefined property: %s::$%s', get_class(), $property ); trigger_error( $message, E_USER_NOTICE); return null; } public function test_unset( $offset ) { unset ( $this->bla[ $offset ] ); } } $test = new Test(); echo $test->bla[2] . PHP_EOL; $test->test_unset( 2 ); echo $test->bla . PHP_EOL; echo $test->bla . PHP_EOL; echo $test->bla . PHP_EOL; echo $test->kaka . PHP_EOL; echo $test->bla . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oYJT
function name:  (null)
number of ops:  26
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        FETCH_OBJ_R                                      ~4      !0, 'bla'
          4        FETCH_DIM_R                                      ~5      ~4, 2
          5        CONCAT                                           ~6      ~5, '%0A'
          6        ECHO                                                     ~6
   29     7        INIT_METHOD_CALL                                         !0, 'test_unset'
          8        SEND_VAL_EX                                              2
          9        DO_FCALL                                      0          
   31    10        FETCH_OBJ_R                                      ~8      !0, 'bla'
         11        CONCAT                                           ~9      ~8, '%0A'
         12        ECHO                                                     ~9
   32    13        FETCH_OBJ_R                                      ~10     !0, 'bla'
         14        CONCAT                                           ~11     ~10, '%0A'
         15        ECHO                                                     ~11
   33    16        FETCH_OBJ_R                                      ~12     !0, 'bla'
         17        CONCAT                                           ~13     ~12, '%0A'
         18        ECHO                                                     ~13
   34    19        FETCH_OBJ_R                                      ~14     !0, 'kaka'
         20        CONCAT                                           ~15     ~14, '%0A'
         21        ECHO                                                     ~15
   35    22        FETCH_OBJ_R                                      ~16     !0, 'bla'
         23        CONCAT                                           ~17     ~16, '%0A'
         24        ECHO                                                     ~17
         25      > RETURN                                                   1

Class Test:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oYJT
function name:  __get
number of ops:  21
compiled vars:  !0 = $property, !1 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        IS_IDENTICAL                                             !0, 'bla'
          2      > JMPZ                                                     ~2, ->8
    6     3    >   ECHO                                                     'Initializing+Text-%3Ebla%0A'
    7     4        ASSIGN_OBJ                                               'bla'
          5        OP_DATA                                                  'Value'
    8     6        FETCH_OBJ_R                                      ~4      'bla'
          7      > RETURN                                                   ~4
   11     8    >   INIT_FCALL                                               'sprintf'
   12     9        SEND_VAL                                                 'Undefined+property%3A+%25s%3A%3A%24%25s'
   13    10        GET_CLASS                                        ~5      
         11        SEND_VAL                                                 ~5
   14    12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
   11    14        ASSIGN                                                   !1, $6
   16    15        INIT_FCALL                                               'trigger_error'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 1024
         18        DO_ICALL                                                 
   17    19      > RETURN                                                   null
   18    20*     > RETURN                                                   null

End of function __get

Function test_unset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4oYJT
function name:  test_unset
number of ops:  4
compiled vars:  !0 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        FETCH_OBJ_UNSET                                  $1      'bla'
          2        UNSET_DIM                                                $1, !0
   22     3      > RETURN                                                   null

End of function test_unset

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.29 ms | 1400 KiB | 17 Q