3v4l.org

run code in 300+ PHP versions simultaneously
<?php $directory = new Directory('.'); $start_time = explode(" ", microtime()); $start_time = $start_time[1] + $start_time[0]; for ($i=1;$i<10000000;$i++) method_exists($directory,'read'); $end_time = explode(" ", microtime()); $end_time = $end_time[1] + $end_time[0]; echo '<br>method_exists time:' . ($end_time - $start_time); $start_time = explode(" ", microtime()); $start_time = $start_time[1] + $start_time[0]; $params = array($directory,'read'); for ($i=1;$i<10000000;$i++) is_callable($params); $end_time = explode(" ", microtime()); $end_time = $end_time[1] + $end_time[0]; echo '<br>is_callable time:' . ($end_time - $start_time); die; class A { static function b() { return 'soy b static'; } function a() { return 'soy a'; } } //$z=new a; //var_dump(is_callable($z::b())); $b=[new a, 'b']; var_dump(is_callable($b, false, $ret)); var_dump($ret); var_dump(get_defined_vars());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 17
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 54
Branch analysis from position: 60
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 54
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 54
Branch analysis from position: 60
Branch analysis from position: 54
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 17
Branch analysis from position: 24
Branch analysis from position: 17
filename:       /in/Wu9L8
function name:  (null)
number of ops:  97
compiled vars:  !0 = $directory, !1 = $start_time, !2 = $i, !3 = $end_time, !4 = $params, !5 = $b, !6 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $7      'Directory'
          1        SEND_VAL_EX                                              '.'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    6     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '+'
          6        INIT_FCALL                                               'microtime'
          7        DO_ICALL                                         $10     
          8        SEND_VAR                                                 $10
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !1, $11
    7    11        FETCH_DIM_R                                      ~13     !1, 1
         12        FETCH_DIM_R                                      ~14     !1, 0
         13        ADD                                              ~15     ~13, ~14
         14        ASSIGN                                                   !1, ~15
   10    15        ASSIGN                                                   !2, 1
         16      > JMP                                                      ->22
   11    17    >   INIT_FCALL                                               'method_exists'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'read'
         20        DO_ICALL                                                 
   10    21        PRE_INC                                                  !2
         22    >   IS_SMALLER                                               !2, 10000000
         23      > JMPNZ                                                    ~20, ->17
   13    24    >   INIT_FCALL                                               'explode'
         25        SEND_VAL                                                 '+'
         26        INIT_FCALL                                               'microtime'
         27        DO_ICALL                                         $21     
         28        SEND_VAR                                                 $21
         29        DO_ICALL                                         $22     
         30        ASSIGN                                                   !3, $22
   14    31        FETCH_DIM_R                                      ~24     !3, 1
         32        FETCH_DIM_R                                      ~25     !3, 0
         33        ADD                                              ~26     ~24, ~25
         34        ASSIGN                                                   !3, ~26
   15    35        SUB                                              ~28     !3, !1
         36        CONCAT                                           ~29     '%3Cbr%3Emethod_exists+time%3A', ~28
         37        ECHO                                                     ~29
   18    38        INIT_FCALL                                               'explode'
         39        SEND_VAL                                                 '+'
         40        INIT_FCALL                                               'microtime'
         41        DO_ICALL                                         $30     
         42        SEND_VAR                                                 $30
         43        DO_ICALL                                         $31     
         44        ASSIGN                                                   !1, $31
   19    45        FETCH_DIM_R                                      ~33     !1, 1
         46        FETCH_DIM_R                                      ~34     !1, 0
         47        ADD                                              ~35     ~33, ~34
         48        ASSIGN                                                   !1, ~35
   21    49        INIT_ARRAY                                       ~37     !0
         50        ADD_ARRAY_ELEMENT                                ~37     'read'
         51        ASSIGN                                                   !4, ~37
   22    52        ASSIGN                                                   !2, 1
         53      > JMP                                                      ->58
   23    54    >   INIT_FCALL                                               'is_callable'
         55        SEND_VAR                                                 !4
         56        DO_ICALL                                                 
   22    57        PRE_INC                                                  !2
         58    >   IS_SMALLER                                               !2, 10000000
         59      > JMPNZ                                                    ~42, ->54
   25    60    >   INIT_FCALL                                               'explode'
         61        SEND_VAL                                                 '+'
         62        INIT_FCALL                                               'microtime'
         63        DO_ICALL                                         $43     
         64        SEND_VAR                                                 $43
         65        DO_ICALL                                         $44     
         66        ASSIGN                                                   !3, $44
   26    67        FETCH_DIM_R                                      ~46     !3, 1
         68        FETCH_DIM_R                                      ~47     !3, 0
         69        ADD                                              ~48     ~46, ~47
         70        ASSIGN                                                   !3, ~48
   27    71        SUB                                              ~50     !3, !1
         72        CONCAT                                           ~51     '%3Cbr%3Eis_callable+time%3A', ~50
         73        ECHO                                                     ~51
   30    74      > EXIT                                                     
   50    75*       NEW                                              $52     'a'
         76*       DO_FCALL                                      0          
         77*       INIT_ARRAY                                       ~54     $52
         78*       ADD_ARRAY_ELEMENT                                ~54     'b'
         79*       ASSIGN                                                   !5, ~54
   52    80*       INIT_FCALL                                               'var_dump'
         81*       INIT_FCALL                                               'is_callable'
         82*       SEND_VAR                                                 !5
         83*       SEND_VAL                                                 <false>
         84*       SEND_REF                                                 !6
         85*       DO_ICALL                                         $56     
         86*       SEND_VAR                                                 $56
         87*       DO_ICALL                                                 
   55    88*       INIT_FCALL                                               'var_dump'
         89*       SEND_VAR                                                 !6
         90*       DO_ICALL                                                 
   58    91*       INIT_FCALL                                               'var_dump'
         92*       INIT_FCALL                                               'get_defined_vars'
         93*       DO_ICALL                                         $59     
         94*       SEND_VAR                                                 $59
         95*       DO_ICALL                                                 
         96*     > RETURN                                                   1

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wu9L8
function name:  b
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E > > RETURN                                                   'soy+b+static'
   36     1*     > RETURN                                                   null

End of function b

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wu9L8
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E > > RETURN                                                   'soy+a'
   41     1*     > RETURN                                                   null

End of function a

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.09 ms | 1396 KiB | 25 Q