3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!function_exists('json_encode'))die(); $types = array( 'boolean' => true, 'integer' => 1, 'double' => 2.2, 'NULL' => NULL); foreach ($types as $key => $type) { echo "$key: var_export>" . var_export($type, 1) . " json_encode>" . json_encode($type) . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/DHqmp
function name:  (null)
number of ops:  27
compiled vars:  !0 = $types, !1 = $type, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'json_encode'
          2        DO_ICALL                                         $3      
          3        BOOL_NOT                                         ~4      $3
          4      > JMPZ                                                     ~4, ->6
          5    > > EXIT                                                     
    4     6    >   ASSIGN                                                   !0, <array>
   10     7      > FE_RESET_R                                       $6      !0, ->25
          8    > > FE_FETCH_R                                       ~7      $6, !1, ->25
          9    >   ASSIGN                                                   !2, ~7
   11    10        NOP                                                      
         11        FAST_CONCAT                                      ~9      !2, '%3A+var_export%3E'
         12        INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $10     
         16        CONCAT                                           ~11     ~9, $10
         17        CONCAT                                           ~12     ~11, '+json_encode%3E'
         18        INIT_FCALL                                               'json_encode'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $13     
         21        CONCAT                                           ~14     ~12, $13
         22        CONCAT                                           ~15     ~14, '%0A'
         23        ECHO                                                     ~15
   10    24      > JMP                                                      ->8
         25    >   FE_FREE                                                  $6
   12    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.68 ms | 1396 KiB | 19 Q