3v4l.org

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

Class Base: [no user functions]
Class Test:
Function malzwei:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5kIce
function name:  malzwei
number of ops:  4
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     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/5kIce
function name:  quadrat
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, !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/5kIce
function name:  getQuadrat
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     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:
158.37 ms | 1392 KiB | 19 Q