3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = <<<STRING PHP is a widely-used general-purpose server side scripting language STRING; $result = []; while (!ctype_space($string)) { $line = []; $string = preg_replace_callback( "~.$|^$~m", function($m) use(&$line) { $line[] = $m[0] === '' ? ' ' : $m[0]; return ''; }, $string, ); array_unshift($result, implode(' ', $line)); } echo implode("\n", $result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 3
Branch analysis from position: 22
Branch analysis from position: 3
filename:       /in/Dlasc
function name:  (null)
number of ops:  25
compiled vars:  !0 = $string, !1 = $result, !2 = $line
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'PHP+is+a%0Awidely-used%0A%0Ageneral-purpose%0Aserver+side%0A%0Ascripting%0Alanguage'
   14     1        ASSIGN                                                       !1, <array>
   15     2      > JMP                                                          ->17
   16     3    >   ASSIGN                                                       !2, <array>
   17     4        INIT_FCALL                                                   'preg_replace_callback'
   18     5        SEND_VAL                                                     '%7E.%24%7C%5E%24%7Em'
   19     6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        BIND_LEXICAL                                                 ~6, !2
   22     8        SEND_VAL                                                     ~6
   23     9        SEND_VAR                                                     !0
   17    10        DO_ICALL                                             $7      
         11        ASSIGN                                                       !0, $7
   25    12        INIT_FCALL                                                   'array_unshift'
         13        SEND_REF                                                     !1
         14        FRAMELESS_ICALL_2                implode             ~9      '+', !2
         15        SEND_VAL                                                     ~9
         16        DO_ICALL                                                     
   15    17    >   INIT_FCALL                                                   'ctype_space'
         18        SEND_VAR                                                     !0
         19        DO_ICALL                                             $11     
         20        BOOL_NOT                                             ~12     $11
         21      > JMPNZ                                                        ~12, ->3
   27    22    >   FRAMELESS_ICALL_2                implode             ~13     '%0A', !1
         23        ECHO                                                         ~13
         24      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Dlasc
function name:  {closure:/in/Dlasc:19}
number of ops:  13
compiled vars:  !0 = $m, !1 = $line
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
   20     2        FETCH_DIM_R                                          ~3      !0, 0
          3        IS_IDENTICAL                                                 ~3, ''
          4      > JMPZ                                                         ~4, ->7
          5    >   QM_ASSIGN                                            ~5      '+'
          6      > JMP                                                          ->9
          7    >   FETCH_DIM_R                                          ~6      !0, 0
          8        QM_ASSIGN                                            ~5      ~6
          9    >   ASSIGN_DIM                                                   !1
         10        OP_DATA                                                      ~5
   21    11      > RETURN                                                       ''
   22    12*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.79 ms | 2045 KiB | 16 Q