3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo { class Bar { public function baz() { return strlen('Regarding the overhead: Just keep in mind, that a typical application calls built-in functions many thousand times. Even if the difference is small: It exists.'); } } $start = microtime(true); $foo = new Bar; for($x = 0; $x < 1000000; $x++) { $foo->baz(); } echo "Time: " . (microtime(true) - $start ) . 'us'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 9
Branch analysis from position: 14
Branch analysis from position: 9
filename:       /in/702jo
function name:  (null)
number of ops:  22
compiled vars:  !0 = $start, !1 = $foo, !2 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cmicrotime'
          1        SEND_VAL_EX                                              <true>
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !0, $3
   10     4        NEW                                              $5      'Foo%5CBar'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   11     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->12
   12     9    >   INIT_METHOD_CALL                                         !1, 'baz'
         10        DO_FCALL                                      0          
   11    11        PRE_INC                                                  !2
         12    >   IS_SMALLER                                               !2, 1000000
         13      > JMPNZ                                                    ~11, ->9
   14    14    >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cmicrotime'
         15        SEND_VAL_EX                                              <true>
         16        DO_FCALL                                      0  $12     
         17        SUB                                              ~13     $12, !0
         18        CONCAT                                           ~14     'Time%3A+', ~13
         19        CONCAT                                           ~15     ~14, 'us'
         20        ECHO                                                     ~15
   15    21      > RETURN                                                   1

Class Foo\Bar:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/702jo
function name:  baz
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_NS_FCALL_BY_NAME                                    'Foo%5Cstrlen'
          1        SEND_VAL_EX                                              'Regarding+the+overhead%3A+Just+keep+in+mind%2C+that+a+typical+application+calls+built-in+functions+many+thousand+times.+Even+if+the+difference+is+small%3A+It+exists.'
          2        DO_FCALL                                      0  $0      
          3      > RETURN                                                   $0
    6     4*     > RETURN                                                   null

End of function baz

End of class Foo\Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.01 ms | 1396 KiB | 17 Q