3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myclass{ public static $i = 0; public function one($called_from = null){ if ( $called_from != 'two'){ return $this->two(); } self::$i += 1; echo self::$i.PHP_EOL; } public function two(){ return $this->one(__FUNCTION__); } } $obj = new myclass; $obj->one();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LA9WY
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'myclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'one'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class myclass:
Function one:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LA9WY
function name:  one
number of ops:  12
compiled vars:  !0 = $called_from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      null
    8     1        IS_NOT_EQUAL                                             !0, 'two'
          2      > JMPZ                                                     ~1, ->6
    9     3    >   INIT_METHOD_CALL                                         'two'
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   11     6    >   ASSIGN_STATIC_PROP_OP                         1          'i'
          7        OP_DATA                                                  1
   12     8        FETCH_STATIC_PROP_R          unknown             ~4      'i'
          9        CONCAT                                           ~5      ~4, '%0A'
         10        ECHO                                                     ~5
   13    11      > RETURN                                                   null

End of function one

Function two:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LA9WY
function name:  two
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'one'
          1        SEND_VAL_EX                                              'two'
          2        DO_FCALL                                      0  $0      
          3      > RETURN                                                   $0
   17     4*     > RETURN                                                   null

End of function two

End of class myclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.38 ms | 1395 KiB | 13 Q