3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function isOk() { return $this->log(true, __FUNCTION__); } public function isFalse() { return $this->log(false, __FUNCTION__); } private function log(mixed $result, string $methodName) { $class = new $methodName; //class exists base on the method name return $class->handle($result); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ceQkr
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   1

Class Test:
Function isok:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ceQkr
function name:  isOk
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'log'
          1        SEND_VAL_EX                                              <true>
          2        SEND_VAL_EX                                              'isOk'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
    8     5*     > RETURN                                                   null

End of function isok

Function isfalse:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ceQkr
function name:  isFalse
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_METHOD_CALL                                         'log'
          1        SEND_VAL_EX                                              <false>
          2        SEND_VAL_EX                                              'isFalse'
          3        DO_FCALL                                      0  $0      
          4      > RETURN                                                   $0
   13     5*     > RETURN                                                   null

End of function isfalse

Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ceQkr
function name:  log
number of ops:  11
compiled vars:  !0 = $result, !1 = $methodName, !2 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        FETCH_CLASS                                   0  $3      !1
          3        NEW                                              $4      $3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $4
   19     6        INIT_METHOD_CALL                                         !2, 'handle'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $7      
          9      > RETURN                                                   $7
   20    10*     > RETURN                                                   null

End of function log

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.13 ms | 1399 KiB | 13 Q