3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = json_decode('[bar'); // many lines of code. $bar = json_encode('Hello world!', JSON_THROW_ON_ERROR); if (json_last_error() !== JSON_ERROR_NONE) { throw new Exception("encoding went wrong!"); } echo "All is fine";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JJD5g
function name:  (null)
number of ops:  19
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%5Bbar'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    7     4        INIT_FCALL                                               'json_encode'
          5        SEND_VAL                                                 'Hello+world%21'
          6        SEND_VAL                                                 4194304
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !1, $4
    8     9        INIT_FCALL                                               'json_last_error'
         10        DO_ICALL                                         $6      
         11        IS_NOT_IDENTICAL                                         $6, 0
         12      > JMPZ                                                     ~7, ->17
    9    13    >   NEW                                              $8      'Exception'
         14        SEND_VAL_EX                                              'encoding+went+wrong%21'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $8
   12    17    >   ECHO                                                     'All+is+fine'
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.77 ms | 1395 KiB | 19 Q