3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stuff = array( array('qty' => 2, 'item' => 'foo'), array('qty' => 3, 'item' => 'bar') ); echo sprintf('<input type="hidden" name="stuffarray" value="%s">', json_encode($stuff)) . PHP_EOL; echo sprintf('<input type="hidden" name="stuffarray" value="%s">', base64_encode(serialize($stuff))) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KlghJ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $stuff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%3Cinput+type%3D%22hidden%22+name%3D%22stuffarray%22+value%3D%22%25s%22%3E'
          3        INIT_FCALL                                               'json_encode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8        CONCAT                                           ~4      $3, '%0A'
          9        ECHO                                                     ~4
    9    10        INIT_FCALL                                               'sprintf'
         11        SEND_VAL                                                 '%3Cinput+type%3D%22hidden%22+name%3D%22stuffarray%22+value%3D%22%25s%22%3E'
         12        INIT_FCALL                                               'base64_encode'
         13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                         $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                         $7      
         20        CONCAT                                           ~8      $7, '%0A'
         21        ECHO                                                     ~8
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.33 ms | 1386 KiB | 21 Q