3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 }
based on RGY8N
Finding entry points
Branch analysis from position: 0
Jump found. (Code = 43) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
Jump found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/AOeJD
function name:  (null)
number of ops:  14
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                                         ~4      ~3, 0
         7      > JMPZ                                                     ~4, ->13
   4     8    >   ECHO                                                     'Run+on+both+PHP+5+and+PHP+7%0A'
   5     9        INIT_FCALL                                               'gettype'
        10        SEND_VAR                                                 !0
        11        DO_ICALL                                         $5      
        12        ECHO                                                     $5
   6    13    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0