3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = new stdClass; $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 = 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 = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 25
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 25
Branch analysis from position: 29
Branch analysis from position: 25
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/Kd4K4
function name:  (null)
number of ops:  52
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 >   NEW                                              $6      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    5     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !1, $9
    6     7        ASSIGN                                                   !2, 100000
          8      > JMP                                                      ->12
    7     9    >   CAST                                          8  ~12     !0
         10        IS_IDENTICAL                                     ~13     !0, ~12
         11        ASSIGN                                                   !3, ~13
    6    12    >   POST_DEC                                         ~15     !2
         13      > JMPNZ                                                    ~15, ->9
    9    14    >   INIT_FCALL                                               'microtime'
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $16     
         17        SUB                                              ~17     $16, !1
         18        ASSIGN                                                   !4, ~17
   11    19        INIT_FCALL                                               'microtime'
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $19     
         22        ASSIGN                                                   !1, $19
   12    23        ASSIGN                                                   !2, 100000
         24      > JMP                                                      ->27
   13    25    >   TYPE_CHECK                                  256  ~22     !0
         26        ASSIGN                                                   !3, ~22
   12    27    >   POST_DEC                                         ~24     !2
         28      > JMPNZ                                                    ~24, ->25
   15    29    >   INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $25     
         32        SUB                                              ~26     $25, !1
         33        ASSIGN                                                   !5, ~26
   17    34        ECHO                                                     'Cast+time%3A'
         35        INIT_FCALL                                               'sprintf'
         36        SEND_VAL                                                 '%250.3f+ms'
         37        MUL                                              ~28     !4, 1000
         38        SEND_VAL                                                 ~28
         39        DO_ICALL                                         $29     
         40        ECHO                                                     $29
         41        ECHO                                                     '%3Cbr%3E'
         42        ECHO                                                     '%0A'
   19    43        ECHO                                                     'Check+time%3A'
         44        INIT_FCALL                                               'sprintf'
         45        SEND_VAL                                                 '%250.3f+ms'
         46        MUL                                              ~30     !5, 1000
         47        SEND_VAL                                                 ~30
         48        DO_ICALL                                         $31     
         49        ECHO                                                     $31
         50        ECHO                                                     '%0A'
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.8 ms | 1400 KiB | 17 Q