3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = str_repeat('a', 1e5); $start = microtime(true); for ($iter = 1e5; $iter--; ) { $result = $var === (object) $var; } $castTime = microtime(true) - $start; $start = microtime(true); for ($iter = 1e5; $iter--; ) { $result = is_object($var); } $checkTime = microtime(true) - $start; echo "Cast time:", sprintf("%0.3f ms", $castTime * 1e3), "<br>", PHP_EOL; echo "Check time:", sprintf("%0.3f ms", $checkTime * 1e3), PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 27
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 27
Branch analysis from position: 31
Branch analysis from position: 27
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 11
Branch analysis from position: 16
Branch analysis from position: 11
filename:       /in/2LOq9
function name:  (null)
number of ops:  54
compiled vars:  !0 = $var, !1 = $start, !2 = $iter, !3 = $result, !4 = $castTime, !5 = $checkTime
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 'a'
          2        SEND_VAL                                                 100000
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    5     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    6     9        ASSIGN                                                   !2, 100000
         10      > JMP                                                      ->14
    7    11    >   CAST                                          8  ~11     !0
         12        IS_IDENTICAL                                     ~12     !0, ~11
         13        ASSIGN                                                   !3, ~12
    6    14    >   POST_DEC                                         ~14     !2
         15      > JMPNZ                                                    ~14, ->11
    9    16    >   INIT_FCALL                                               'microtime'
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $15     
         19        SUB                                              ~16     $15, !1
         20        ASSIGN                                                   !4, ~16
   11    21        INIT_FCALL                                               'microtime'
         22        SEND_VAL                                                 <true>
         23        DO_ICALL                                         $18     
         24        ASSIGN                                                   !1, $18
   12    25        ASSIGN                                                   !2, 100000
         26      > JMP                                                      ->29
   13    27    >   TYPE_CHECK                                  256  ~21     !0
         28        ASSIGN                                                   !3, ~21
   12    29    >   POST_DEC                                         ~23     !2
         30      > JMPNZ                                                    ~23, ->27
   15    31    >   INIT_FCALL                                               'microtime'
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $24     
         34        SUB                                              ~25     $24, !1
         35        ASSIGN                                                   !5, ~25
   17    36        ECHO                                                     'Cast+time%3A'
         37        INIT_FCALL                                               'sprintf'
         38        SEND_VAL                                                 '%250.3f+ms'
         39        MUL                                              ~27     !4, 1000
         40        SEND_VAL                                                 ~27
         41        DO_ICALL                                         $28     
         42        ECHO                                                     $28
         43        ECHO                                                     '%3Cbr%3E'
         44        ECHO                                                     '%0A'
   19    45        ECHO                                                     'Check+time%3A'
         46        INIT_FCALL                                               'sprintf'
         47        SEND_VAL                                                 '%250.3f+ms'
         48        MUL                                              ~29     !5, 1000
         49        SEND_VAL                                                 ~29
         50        DO_ICALL                                         $30     
         51        ECHO                                                     $30
         52        ECHO                                                     '%0A'
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1400 KiB | 19 Q