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; } } $test = new Test(); echo $test->bla[2] . PHP_EOL; 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/vSVcu
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        FETCH_OBJ_R                                      ~4      !0, 'bla'
          4        FETCH_DIM_R                                      ~5      ~4, 2
          5        CONCAT                                           ~6      ~5, '%0A'
          6        ECHO                                                     ~6
   25     7        FETCH_OBJ_R                                      ~7      !0, 'bla'
          8        CONCAT                                           ~8      ~7, '%0A'
          9        ECHO                                                     ~8
   26    10        FETCH_OBJ_R                                      ~9      !0, 'bla'
         11        CONCAT                                           ~10     ~9, '%0A'
         12        ECHO                                                     ~10
   27    13        FETCH_OBJ_R                                      ~11     !0, 'bla'
         14        CONCAT                                           ~12     ~11, '%0A'
         15        ECHO                                                     ~12
   28    16        FETCH_OBJ_R                                      ~13     !0, 'kaka'
         17        CONCAT                                           ~14     ~13, '%0A'
         18        ECHO                                                     ~14
   29    19        FETCH_OBJ_R                                      ~15     !0, 'bla'
         20        CONCAT                                           ~16     ~15, '%0A'
         21        ECHO                                                     ~16
         22      > 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/vSVcu
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

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.2 ms | 1404 KiB | 17 Q