3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = substr("foo",3); if(strlen($foo) == 0){ echo "Run on both PHP 5 and PHP 7\n"; echo gettype($foo); //boolean on PHP 5 and string on PHP 7 }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/AOeJD
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'substr'
          1        SEND_VAL                                                 'foo'
          2        SEND_VAL                                                 3
          3        DO_ICALL                                         $1      
          4        ASSIGN                                                   !0, $1
    3     5        STRLEN                                           ~3      !0
          6        IS_EQUAL                                                 ~3, 0
          7      > JMPZ                                                     ~4, ->11
    4     8    >   ECHO                                                     'Run+on+both+PHP+5+and+PHP+7%0A'
    5     9        GET_TYPE                                         ~5      !0
         10        ECHO                                                     ~5
    6    11    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.41 ms | 991 KiB | 14 Q