3v4l.org

run code in 300+ PHP versions simultaneously
<?php $all_blogs = [1,2,3]; $left_blogs = [3]; $all_blogs_total = count($all_blogs); $left_blogs_total = count($left_blogs); if (($diff = $all_blogs_total - $left_blogs_total) >0) { $left_blogs = array_merge($left_blogs, array_slice($all_blogs, 0, $diff)); } print_r($left_blogs);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 20
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/q2Xo1
function name:  (null)
number of ops:  24
compiled vars:  !0 = $all_blogs, !1 = $left_blogs, !2 = $all_blogs_total, !3 = $left_blogs_total, !4 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        COUNT                                            ~7      !0
          3        ASSIGN                                                   !2, ~7
    5     4        COUNT                                            ~9      !1
          5        ASSIGN                                                   !3, ~9
    6     6        SUB                                              ~11     !2, !3
          7        ASSIGN                                           ~12     !4, ~11
          8        IS_SMALLER                                               0, ~12
          9      > JMPZ                                                     ~13, ->20
    7    10    >   INIT_FCALL                                               'array_merge'
         11        SEND_VAR                                                 !1
         12        INIT_FCALL                                               'array_slice'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $14     
         17        SEND_VAR                                                 $14
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !1, $15
   10    20    >   INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.1 ms | 1387 KiB | 19 Q