3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { bar(); } function bar() { baz(); } function baz() { boom(); } function boom() { return false; } function test($n) { for ($i = 0; $i < $n; $i++) { foo(); } } $n = 1000000; $t = microtime(true); test($n); echo (microtime(true) - $t)*1000000/$n . ' us/iteration';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC6vm
function name:  (null)
number of ops:  17
compiled vars:  !0 = $n, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, 1000000
   26     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   27     5        INIT_FCALL                                               'test'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0          
   28     8        INIT_FCALL                                               'microtime'
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $6      
         11        SUB                                              ~7      $6, !1
         12        MUL                                              ~8      ~7, 1000000
         13        DIV                                              ~9      ~8, !0
         14        CONCAT                                           ~10     ~9, '+us%2Fiteration'
         15        ECHO                                                     ~10
         16      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC6vm
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'bar'
          1        DO_FCALL                                      0          
    5     2      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC6vm
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL_BY_NAME                                       'baz'
          1        DO_FCALL                                      0          
    9     2      > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC6vm
function name:  baz
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL_BY_NAME                                       'boom'
          1        DO_FCALL                                      0          
   13     2      > RETURN                                                   null

End of function baz

Function boom:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hC6vm
function name:  boom
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   <false>
   17     1*     > RETURN                                                   null

End of function boom

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 3
Branch analysis from position: 8
Branch analysis from position: 3
filename:       /in/hC6vm
function name:  test
number of ops:  9
compiled vars:  !0 = $n, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->6
   21     3    >   INIT_FCALL                                               'foo'
          4        DO_FCALL                                      0          
   20     5        PRE_INC                                                  !1
          6    >   IS_SMALLER                                               !1, !0
          7      > JMPNZ                                                    ~5, ->3
   23     8    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.67 ms | 1452 KiB | 16 Q