3v4l.org

run code in 300+ 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:  27
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                                               'implode'
          7        SEND_VAL                                                 '+'
          8        INIT_FCALL                                               'array_splice'
          9        SEND_REF                                                 !1
         10        SEND_VAL                                                 -2
         11        DO_ICALL                                         $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !2, $9
    5    15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '+'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        ASSIGN                                                   !3, $11
    6    20        CONCAT                                           ~13     '%3Cp%3E', !3
         21        CONCAT                                           ~14     ~13, '+%3Cspan+class%3D%22someclass%22%3E'
         22        CONCAT                                           ~15     ~14, !2
         23        CONCAT                                           ~16     ~15, '%3C%2Fspan%3E%3C%2Fp%3E'
         24        ASSIGN                                                   !4, ~16
    7    25        ECHO                                                     !4
    8    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.34 ms | 1447 KiB | 16 Q