3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.98 ms | 1400 KiB | 17 Q