3v4l.org

run code in 300+ PHP versions simultaneously
<?php class o { function __set($name,$val) { $name= 'set_'.$name; if(method_exists($this,$name)) $this->{$name}($val); else $this->{$name}= $val; // causing infinite recursion } } $o= new o; $o->some_prop= 10; // infinite recursion occurs
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EgfMa
function name:  (null)
number of ops:  6
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'o'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        ASSIGN_OBJ                                               !0, 'some_prop'
          4        OP_DATA                                                  10
          5      > RETURN                                                   1

Class o:
Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EgfMa
function name:  __set
number of ops:  17
compiled vars:  !0 = $name, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        CONCAT                                           ~2      'set_', !0
          3        ASSIGN                                                   !0, ~2
    7     4        INIT_FCALL                                               'method_exists'
          5        FETCH_THIS                                       ~4      
          6        SEND_VAL                                                 ~4
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9      > JMPZ                                                     $5, ->14
    8    10    >   INIT_METHOD_CALL                                         !0
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0          
         13      > JMP                                                      ->16
   10    14    >   ASSIGN_OBJ                                               !0
         15        OP_DATA                                                  !1
   11    16    > > RETURN                                                   null

End of function __set

End of class o.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.72 ms | 1395 KiB | 15 Q