3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = range(1,5); $text = implode(', ', $range); $text = preg_replace('/, (?=[^,]+$)/',' and ', $text); echo $text;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6WJRT
function name:  (null)
number of ops:  18
compiled vars:  !0 = $range, !1 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'range'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 5
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !0, $2
    4     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%2C+'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    5    10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAL                                                 '%2F%2C+%28%3F%3D%5B%5E%2C%5D%2B%24%29%2F'
         12        SEND_VAL                                                 '+and+'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $6      
         15        ASSIGN                                                   !1, $6
    7    16        ECHO                                                     !1
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.63 ms | 1394 KiB | 19 Q