3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public function getRowCount($table){ if($table == 'taco'){ return 50; } return 20; } } $faqConfig = new X; $faqRowCount = function($table) use($faqConfig){ return $faqConfig->getRowCount($table); }; echo $faqRowCount('taco') . "\n"; echo $faqRowCount('xyz');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i5DMR
function name:  (null)
number of ops:  16
compiled vars:  !0 = $faqConfig, !1 = $faqRowCount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $2      'X'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fi5DMR%3A14%240'
          4        BIND_LEXICAL                                             ~5, !0
          5        ASSIGN                                                   !1, ~5
   18     6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAL_EX                                              'taco'
          8        DO_FCALL                                      0  $7      
          9        CONCAT                                           ~8      $7, '%0A'
         10        ECHO                                                     ~8
   19    11        INIT_DYNAMIC_CALL                                        !1
         12        SEND_VAL_EX                                              'xyz'
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
         15      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fi5DMR%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i5DMR
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $table, !1 = $faqConfig
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        INIT_METHOD_CALL                                         !1, 'getRowCount'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   16     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fi5DMR%3A14%240

Class X:
Function getrowcount:
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/i5DMR
function name:  getRowCount
number of ops:  6
compiled vars:  !0 = $table
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                                 !0, 'taco'
          2      > JMPZ                                                     ~1, ->4
    5     3    > > RETURN                                                   50
    8     4    > > RETURN                                                   20
    9     5*     > RETURN                                                   null

End of function getrowcount

End of class X.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.21 ms | 1395 KiB | 13 Q