3v4l.org

run code in 300+ 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 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 3
Branch analysis from position: 25
Branch analysis from position: 3
filename:       /in/Dlasc
function name:  (null)
number of ops:  31
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                                                      ->20
   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        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '+'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                                 
   15    20    >   INIT_FCALL                                               'ctype_space'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $11     
         23        BOOL_NOT                                         ~12     $11
         24      > JMPNZ                                                    ~12, ->3
   27    25    >   INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%0A'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                         $13     
         29        ECHO                                                     $13
         30      > 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}
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.0.0


preferences:
142.58 ms | 1006 KiB | 17 Q