3v4l.org

run code in 300+ PHP versions simultaneously
<?php $phones = "Samsung Galaxy S8~LG G6~iPhone 7 Plus~ Motorola Z2"; $value = preg_replace('/(\d+.*?)(~)/', '($1)$2', $phones . "~"); $value = "<li>". str_replace("~", ",</li>\n<li>", substr($value,0,-1)) . "</li>"; Echo $value;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sCkjg
function name:  (null)
number of ops:  23
compiled vars:  !0 = $phones, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Samsung+Galaxy+S8%7ELG+G6%7EiPhone+7+Plus%7E+Motorola+Z2'
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%28%5Cd%2B.%2A%3F%29%28%7E%29%2F'
          3        SEND_VAL                                                 '%28%241%29%242'
          4        CONCAT                                           ~3      !0, '%7E'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    7     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAL                                                 '%7E'
         10        SEND_VAL                                                 '%2C%3C%2Fli%3E%0A%3Cli%3E'
         11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !1
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 -1
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                         $7      
         18        CONCAT                                           ~8      '%3Cli%3E', $7
         19        CONCAT                                           ~9      ~8, '%3C%2Fli%3E'
         20        ASSIGN                                                   !1, ~9
    9    21        ECHO                                                     !1
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.1 ms | 1012 KiB | 16 Q