3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ 'false' => false, 'true' => true, 'null' => null, '0' => 0, '0.1' => 0.1, 'a' => 'a', '[\'foo\']' => ['foo'], '(object) [\'bar\', \'bar\']' => (object) ['bar', 'bar'], ]; echo "<table border=1>"; echo '<tr><th>input</th><th>echo</th><th>printf</th><th>print_r</th><th>var_export</th><th>var_dump</th></tr>'; foreach ($tests as $input => $test) { echo "<tr>"; echo "<th>$input</th><td>"; echo is_array($test) || is_object($test) ? json_encode($test) : $test; echo "</td><td>"; printf('%s', is_array($test) || is_object($test) ? json_encode($test) : $test); echo "</td><td>"; print_r($test); echo "</td><td>"; var_export($test); echo "</td><td>"; var_dump($test); echo "</td></tr>"; } echo "</table>";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 62
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 62
Branch analysis from position: 14
2 jumps found. (Code = 47) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 39
Branch analysis from position: 30
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 39
Branch analysis from position: 37
Branch analysis from position: 39
Branch analysis from position: 24
Branch analysis from position: 62
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
filename:       /in/CoAFd
function name:  (null)
number of ops:  65
compiled vars:  !0 = $tests, !1 = $test, !2 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~3      <false>, 'false'
          1        ADD_ARRAY_ELEMENT                                ~3      <true>, 'true'
          2        ADD_ARRAY_ELEMENT                                ~3      null, 'null'
    7     3        ADD_ARRAY_ELEMENT                                ~3      0, 0
    8     4        ADD_ARRAY_ELEMENT                                ~3      0.1, '0.1'
    9     5        ADD_ARRAY_ELEMENT                                ~3      'a', 'a'
    4     6        ADD_ARRAY_ELEMENT                                ~3      <array>, '%5B%27foo%27%5D'
   11     7        CAST                                          8  ~4      <array>
          8        ADD_ARRAY_ELEMENT                                ~3      ~4, '%28object%29+%5B%27bar%27%2C+%27bar%27%5D'
    3     9        ASSIGN                                                   !0, ~3
   14    10        ECHO                                                     '%3Ctable+border%3D1%3E'
   15    11        ECHO                                                     '%3Ctr%3E%3Cth%3Einput%3C%2Fth%3E%3Cth%3Eecho%3C%2Fth%3E%3Cth%3Eprintf%3C%2Fth%3E%3Cth%3Eprint_r%3C%2Fth%3E%3Cth%3Evar_export%3C%2Fth%3E%3Cth%3Evar_dump%3C%2Fth%3E%3C%2Ftr%3E'
   16    12      > FE_RESET_R                                       $6      !0, ->62
         13    > > FE_FETCH_R                                       ~7      $6, !1, ->62
         14    >   ASSIGN                                                   !2, ~7
   17    15        ECHO                                                     '%3Ctr%3E'
   18    16        ROPE_INIT                                     3  ~10     '%3Cth%3E'
         17        ROPE_ADD                                      1  ~10     ~10, !2
         18        ROPE_END                                      2  ~9      ~10, '%3C%2Fth%3E%3Ctd%3E'
         19        ECHO                                                     ~9
   19    20        TYPE_CHECK                                  128  ~12     !1
         21      > JMPNZ_EX                                         ~12     ~12, ->24
         22    >   TYPE_CHECK                                  256  ~13     !1
         23        BOOL                                             ~12     ~13
         24    > > JMPZ                                                     ~12, ->30
         25    >   INIT_FCALL                                               'json_encode'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $14     
         28        QM_ASSIGN                                        ~15     $14
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~15     !1
         31    >   ECHO                                                     ~15
   20    32        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   21    33        INIT_FCALL                                               'printf'
         34        SEND_VAL                                                 '%25s'
         35        TYPE_CHECK                                  128  ~16     !1
         36      > JMPNZ_EX                                         ~16     ~16, ->39
         37    >   TYPE_CHECK                                  256  ~17     !1
         38        BOOL                                             ~16     ~17
         39    > > JMPZ                                                     ~16, ->45
         40    >   INIT_FCALL                                               'json_encode'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $18     
         43        QM_ASSIGN                                        ~19     $18
         44      > JMP                                                      ->46
         45    >   QM_ASSIGN                                        ~19     !1
         46    >   SEND_VAL                                                 ~19
         47        DO_ICALL                                                 
   22    48        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   23    49        INIT_FCALL                                               'print_r'
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                                 
   24    52        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   25    53        INIT_FCALL                                               'var_export'
         54        SEND_VAR                                                 !1
         55        DO_ICALL                                                 
   26    56        ECHO                                                     '%3C%2Ftd%3E%3Ctd%3E'
   27    57        INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !1
         59        DO_ICALL                                                 
   28    60        ECHO                                                     '%3C%2Ftd%3E%3C%2Ftr%3E'
   16    61      > JMP                                                      ->13
         62    >   FE_FREE                                                  $6
   30    63        ECHO                                                     '%3C%2Ftable%3E'
         64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.45 ms | 1007 KiB | 18 Q