3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text_array = ['He needs to cultivate in order', 'to be at the fourth level of the', 'Martial Body Stage. Does he have inner energy?"', 'Everyone jeered, laughed, and taunted.', 'Qin Yun turned deaf ear to their taunts.', 'His eyes were filled with sincerity as he', 'looked at Yang Shiyue and said, "Teacher,', 'I only formed my elemental energy this morning.', 'I still not familiar with the control of', 'my elemental energy and inner energy."', 'After the empress heard the jeers from the', 'crowd, she let out a sigh of relief and', 'sneered, "This is only a little bit of', 'inner Qi that you forced out.', 'You have not yet stepped', 'into the fourth level', 'of the Martial Body realm and have no', 'chance of breaking through. embarrass yourself!']; function change_words_length($text, $numwords) { $words = explode(' ', implode(' ', $text)); $output = array(); foreach (array_chunk($words, $numwords) as $array) { $output[] = implode(' ', $array); } return $output; } print_r(change_words_length($text_array, 10)); print_r(change_words_length($text_array, 30));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/188K1
function name:  (null)
number of ops:  16
compiled vars:  !0 = $text_array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   31     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'change_words_length'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 10
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
   32     8        INIT_FCALL                                               'print_r'
          9        INIT_FCALL                                               'change_words_length'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 30
         12        DO_FCALL                                      0  $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function change_words_length:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 25
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/188K1
function name:  change_words_length
number of ops:  28
compiled vars:  !0 = $text, !1 = $numwords, !2 = $words, !3 = $output, !4 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+'
          4        INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '+'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
   24    11        ASSIGN                                                   !3, <array>
   25    12        INIT_FCALL                                               'array_chunk'
         13        SEND_VAR                                                 !2
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $9      
         16      > FE_RESET_R                                       $10     $9, ->25
         17    > > FE_FETCH_R                                               $10, !4, ->25
   26    18    >   INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '+'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                         $12     
         22        ASSIGN_DIM                                               !3
         23        OP_DATA                                                  $12
   25    24      > JMP                                                      ->17
         25    >   FE_FREE                                                  $10
   28    26      > RETURN                                                   !3
   29    27*     > RETURN                                                   null

End of function change_words_length

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.52 ms | 1407 KiB | 23 Q