3v4l.org

run code in 300+ PHP versions simultaneously
<?php function escapeShellArgument( $argument ) { $escapeChar = '"'; $argument = str_replace( $escapeChar, "\\" . $escapeChar, addcslashes( $argument, '\\' ) ); var_dump($escapeChar . $argument . $escapeChar); } mb_internal_encoding("Shift_JIS"); escapeShellArgument("0ノルウェーサーモンのカルパッチョ"); escapeShellArgument("'00サーモンを薄切りにし、お\"皿に均等に並べ、塩、コショウを軽く振っておきます。"); escapeShellArgument("\"this should work!\"");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KGTeT
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'mb_internal_encoding'
          1        SEND_VAL                                                 'Shift_JIS'
          2        DO_ICALL                                                 
   10     3        INIT_FCALL                                               'escapeshellargument'
          4        SEND_VAL                                                 '0%E3%83%8E%E3%83%AB%E3%82%A6%E3%82%A7%E3%83%BC%E3%82%B5%E3%83%BC%E3%83%A2%E3%83%B3%E3%81%AE%E3%82%AB%E3%83%AB%E3%83%91%E3%83%83%E3%83%81%E3%83%A7'
          5        DO_FCALL                                      0          
   11     6        INIT_FCALL                                               'escapeshellargument'
          7        SEND_VAL                                                 '%2700%E3%82%B5%E3%83%BC%E3%83%A2%E3%83%B3%E3%82%92%E8%96%84%E5%88%87%E3%82%8A%E3%81%AB%E3%81%97%E3%80%81%E3%81%8A%22%E7%9A%BF%E3%81%AB%E5%9D%87%E7%AD%89%E3%81%AB%E4%B8%A6%E3%81%B9%E3%80%81%E5%A1%A9%E3%80%81%E3%82%B3%E3%82%B7%E3%83%A7%E3%82%A6%E3%82%92%E8%BB%BD%E3%81%8F%E6%8C%AF%E3%81%A3%E3%81%A6%E3%81%8A%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82'
          8        DO_FCALL                                      0          
   12     9        INIT_FCALL                                               'escapeshellargument'
         10        SEND_VAL                                                 '%22this+should+work%21%22'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function escapeshellargument:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KGTeT
function name:  escapeShellArgument
number of ops:  19
compiled vars:  !0 = $argument, !1 = $escapeChar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, '%22'
    6     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAR                                                 !1
          4        CONCAT                                           ~3      '%5C', !1
          5        SEND_VAL                                                 ~3
          6        INIT_FCALL                                               'addcslashes'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '%5C'
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !0, $5
    7    13        INIT_FCALL                                               'var_dump'
         14        CONCAT                                           ~7      !1, !0
         15        CONCAT                                           ~8      ~7, !1
         16        SEND_VAL                                                 ~8
         17        DO_ICALL                                                 
    8    18      > RETURN                                                   null

End of function escapeshellargument

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.92 ms | 1390 KiB | 24 Q