3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ERROR); class B { /** * @param string $p * @return string */ function g($p) { if (!$p) { return null; } return $p; } } class C extends B { function f($p) { return $this->$p[0]; } /** * @param int $p * @return int */ function g($p) { $this->p = $p; $this->property = [42]; return $this->f($p); } } print (new C)->g('property' . $undeclared_global) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q2WM6
function name:  (null)
number of ops:  12
compiled vars:  !0 = $undeclared_global
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 1
          2        DO_ICALL                                                 
   34     3        NEW                                              $2      'C'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $2, 'g'
          6        CONCAT                                           ~4      'property', !0
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0  $5      
          9        CONCAT                                           ~6      $5, '%0A'
         10        ECHO                                                     ~6
         11      > RETURN                                                   1

Class B:
Function g:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q2WM6
function name:  g
number of ops:  6
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->4
   11     3    > > RETURN                                                   null
   13     4    > > RETURN                                                   !0
   14     5*     > RETURN                                                   null

End of function g

End of class B.

Class C:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q2WM6
function name:  f
number of ops:  5
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        FETCH_OBJ_R                                      ~1      !0
          2        FETCH_DIM_R                                      ~2      ~1, 0
          3      > RETURN                                                   ~2
   20     4*     > RETURN                                                   null

End of function f

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q2WM6
function name:  g
number of ops:  10
compiled vars:  !0 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        ASSIGN_OBJ                                               'p'
          2        OP_DATA                                                  !0
   28     3        ASSIGN_OBJ                                               'property'
          4        OP_DATA                                                  <array>
   29     5        INIT_METHOD_CALL                                         'f'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0  $3      
          8      > RETURN                                                   $3
   30     9*     > RETURN                                                   null

End of function g

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.69 ms | 1400 KiB | 15 Q