3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { protected $quadrat; public function getQuadrat() { echo is_callable($this->quadrat) ? 'Yes' : 'No'; echo "\n"; return $this->quadrat; } } class Test extends Base { public function malzwei($n) { return $n * 2; } public function quadrat($n) { return $n * $n; } } $t = new Test(); echo call_user_func($t->getQuadrat(), 3); var_dump(array_map($t->getQuadrat(), array(1, 2, 3, 4)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737dH
function name:  (null)
number of ops:  19
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_METHOD_CALL                                         !0, 'getQuadrat'
          4        DO_FCALL                                      0  $4      
          5        INIT_USER_CALL                                1          'call_user_func', $4
          6        SEND_USER                                                3
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
   13     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'array_map'
         11        INIT_METHOD_CALL                                         !0, 'getQuadrat'
         12        DO_FCALL                                      0  $6      
         13        SEND_VAR                                                 $6
         14        SEND_VAL                                                 <array>
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Class Base:
Function getquadrat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737dH
function name:  getQuadrat
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'is_callable'
          1        FETCH_OBJ_R                                      ~0      'quadrat'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->7
          5    >   QM_ASSIGN                                        ~2      'Yes'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~2      'No'
          8    >   ECHO                                                     ~2
          9        ECHO                                                     '%0A'
         10        FETCH_OBJ_R                                      ~3      'quadrat'
         11      > RETURN                                                   ~3
         12*     > RETURN                                                   null

End of function getquadrat

End of class Base.

Class Test:
Function malzwei:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737dH
function name:  malzwei
number of ops:  4
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, 2
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function malzwei

Function quadrat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737dH
function name:  quadrat
number of ops:  4
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        MUL                                              ~1      !0, !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function quadrat

Function getquadrat:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/737dH
function name:  getQuadrat
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'is_callable'
          1        FETCH_OBJ_R                                      ~0      'quadrat'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->7
          5    >   QM_ASSIGN                                        ~2      'Yes'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~2      'No'
          8    >   ECHO                                                     ~2
          9        ECHO                                                     '%0A'
         10        FETCH_OBJ_R                                      ~3      'quadrat'
         11      > RETURN                                                   ~3
         12*     > RETURN                                                   null

End of function getquadrat

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.89 ms | 1400 KiB | 19 Q