3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { const TYPE = 'x'; } class Y { const TYPE = 'y'; } $y = new Y(); $x = new X(); $time = microtime(true); echo ($y::TYPE === 'y'); echo ($y::TYPE === 'x'); $time = microtime(true) - $time; echo '1 took '. $time; echo "\n"; $time = microtime(true); echo ($y instanceof Y); echo ($y instanceof X); $time = microtime(true) - $time; echo '2 took '. $time;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1NcAC
function name:  (null)
number of ops:  42
compiled vars:  !0 = $y, !1 = $x, !2 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $3      'Y'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   14     3        NEW                                              $6      'X'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $6
   16     6        INIT_FCALL                                               'microtime'
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
   17    10        FETCH_CLASS                                   0  $11     !0
         11        FETCH_CLASS_CONSTANT                             ~12     $11, 'TYPE'
         12        IS_IDENTICAL                                     ~13     ~12, 'y'
         13        ECHO                                                     ~13
   18    14        FETCH_CLASS                                   0  $14     !0
         15        FETCH_CLASS_CONSTANT                             ~15     $14, 'TYPE'
         16        IS_IDENTICAL                                     ~16     ~15, 'x'
         17        ECHO                                                     ~16
   19    18        INIT_FCALL                                               'microtime'
         19        SEND_VAL                                                 <true>
         20        DO_ICALL                                         $17     
         21        SUB                                              ~18     $17, !2
         22        ASSIGN                                                   !2, ~18
   20    23        CONCAT                                           ~20     '1+took+', !2
         24        ECHO                                                     ~20
   21    25        ECHO                                                     '%0A'
   23    26        INIT_FCALL                                               'microtime'
         27        SEND_VAL                                                 <true>
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !2, $21
   24    30        INSTANCEOF                                       ~23     !0, 'Y'
         31        ECHO                                                     ~23
   25    32        INSTANCEOF                                       ~24     !0, 'X'
         33        ECHO                                                     ~24
   26    34        INIT_FCALL                                               'microtime'
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $25     
         37        SUB                                              ~26     $25, !2
         38        ASSIGN                                                   !2, ~26
   27    39        CONCAT                                           ~28     '2+took+', !2
         40        ECHO                                                     ~28
         41      > RETURN                                                   1

Class X: [no user functions]
Class Y: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.96 ms | 1396 KiB | 15 Q