3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "foo\x00bar\x00baz"; function showRawCharacters($result) { $resultInHex = unpack('H*', $result); $resultInHex = $resultInHex[1]; $resultSeparated = implode(', ', str_split($resultInHex, 2)); //byte safe echo $resultSeparated."\n"; } showRawCharacters($str1); echo "strcmp = ".strcmp($str1, "foo\x00bar\x00baz")."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jrP74
function name:  (null)
number of ops:  12
compiled vars:  !0 = $str1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'foo%00bar%00baz'
   14     1        INIT_FCALL                                               'showrawcharacters'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   17     4        INIT_FCALL                                               'strcmp'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'foo%00bar%00baz'
          7        DO_ICALL                                         $3      
          8        CONCAT                                           ~4      'strcmp+%3D+', $3
          9        CONCAT                                           ~5      ~4, '%0A'
         10        ECHO                                                     ~5
         11      > RETURN                                                   1

Function showrawcharacters:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jrP74
function name:  showRawCharacters
number of ops:  20
compiled vars:  !0 = $result, !1 = $resultInHex, !2 = $resultSeparated
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'unpack'
          2        SEND_VAL                                                 'H%2A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    8     6        FETCH_DIM_R                                      ~5      !1, 1
          7        ASSIGN                                                   !1, ~5
    9     8        INIT_FCALL                                               'implode'
          9        SEND_VAL                                                 '%2C+'
         10        INIT_FCALL                                               'str_split'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                         $8      
         16        ASSIGN                                                   !2, $8
   10    17        CONCAT                                           ~10     !2, '%0A'
         18        ECHO                                                     ~10
   11    19      > RETURN                                                   null

End of function showrawcharacters

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
202.53 ms | 1399 KiB | 22 Q