3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'this is a returned string'; $words = explode(" ", $string ); $last_two_word = implode(' ',array_splice($words, -2 )); $except_last_two = implode(' ', $words); $expected = '<p>'.$except_last_two.' <span class="someclass">'.$last_two_word.'</span></p>'; echo $expected; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d3DYq
function name:  (null)
number of ops:  21
compiled vars:  !0 = $string, !1 = $words, !2 = $last_two_word, !3 = $except_last_two, !4 = $expected
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'this+is+a+returned+string'
    3     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '+'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    4     6        INIT_FCALL                                                   'array_splice'
          7        SEND_REF                                                     !1
          8        SEND_VAL                                                     -2
          9        DO_ICALL                                             $8      
         10        FRAMELESS_ICALL_2                implode             ~9      '+', $8
         11        ASSIGN                                                       !2, ~9
    5    12        FRAMELESS_ICALL_2                implode             ~11     '+', !1
         13        ASSIGN                                                       !3, ~11
    6    14        CONCAT                                               ~13     '%3Cp%3E', !3
         15        CONCAT                                               ~14     ~13, '+%3Cspan+class%3D%22someclass%22%3E'
         16        CONCAT                                               ~15     ~14, !2
         17        CONCAT                                               ~16     ~15, '%3C%2Fspan%3E%3C%2Fp%3E'
         18        ASSIGN                                                       !4, ~16
    7    19        ECHO                                                         !4
    8    20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.81 ms | 2150 KiB | 15 Q