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' . number_format($time, 3); $time = microtime(true); echo ($y instanceof Y); echo ($y instanceof X); $time = microtime(true) - $time; echo '2 took' . number_format($time, 3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cmJn7
function name:  (null)
number of ops:  49
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        INIT_FCALL                                               'number_format'
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 3
         26        DO_ICALL                                         $20     
         27        CONCAT                                           ~21     '1+took', $20
         28        ECHO                                                     ~21
   22    29        INIT_FCALL                                               'microtime'
         30        SEND_VAL                                                 <true>
         31        DO_ICALL                                         $22     
         32        ASSIGN                                                   !2, $22
   23    33        INSTANCEOF                                       ~24     !0, 'Y'
         34        ECHO                                                     ~24
   24    35        INSTANCEOF                                       ~25     !0, 'X'
         36        ECHO                                                     ~25
   25    37        INIT_FCALL                                               'microtime'
         38        SEND_VAL                                                 <true>
         39        DO_ICALL                                         $26     
         40        SUB                                              ~27     $26, !2
         41        ASSIGN                                                   !2, ~27
   26    42        INIT_FCALL                                               'number_format'
         43        SEND_VAR                                                 !2
         44        SEND_VAL                                                 3
         45        DO_ICALL                                         $29     
         46        CONCAT                                           ~30     '2+took', $29
         47        ECHO                                                     ~30
         48      > RETURN                                                   1

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.88 ms | 1400 KiB | 17 Q