3v4l.org

run code in 300+ PHP versions simultaneously
<?php $addresses=array(); $name = "company name"; $add = "Jon and Jane's Spot,AL"; array_push($addresses,array( str_replace("'","\'",$add))); print_r($addresses); echo json_encode($addresses);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H9BkM
function name:  (null)
number of ops:  21
compiled vars:  !0 = $addresses, !1 = $name, !2 = $add
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 'company+name'
    4     2        ASSIGN                                                   !2, 'Jon+and+Jane%27s+Spot%2CAL'
    5     3        INIT_FCALL                                               'array_push'
          4        SEND_REF                                                 !0
          5        INIT_FCALL                                               'str_replace'
          6        SEND_VAL                                                 '%27'
          7        SEND_VAL                                                 '%5C%27'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $6      
         10        INIT_ARRAY                                       ~7      $6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
    6    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
    7    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $10     
         19        ECHO                                                     $10
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.26 ms | 1002 KiB | 17 Q