3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function __get($p) { if ($p == 'a') return 'b'; else return 'xx'; } } $x = new x; for ($i=0; $i<99999; $i++) $z += strlen($x->a); print $z;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/H8Edv
function name:  (null)
number of ops:  13
compiled vars:  !0 = $x, !1 = $i, !2 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $3      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   16     3        ASSIGN                                                   !1, 0
          4      > JMP                                                      ->9
   17     5    >   FETCH_OBJ_R                                      ~7      !0, 'a'
          6        STRLEN                                           ~8      ~7
          7        ASSIGN_OP                                     1          !2, ~8
   16     8        PRE_INC                                                  !1
          9    >   IS_SMALLER                                               !1, 99999
         10      > JMPNZ                                                    ~11, ->5
   19    11    >   ECHO                                                     !2
         12      > RETURN                                                   1

Class x:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H8Edv
function name:  __get
number of ops:  7
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        IS_EQUAL                                                 !0, 'a'
          2      > JMPZ                                                     ~1, ->5
    8     3    > > RETURN                                                   'b'
          4*       JMP                                                      ->6
   10     5    > > RETURN                                                   'xx'
   11     6*     > RETURN                                                   null

End of function __get

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1394 KiB | 13 Q