3v4l.org

run code in 500+ PHP versions simultaneously
<?php $primul = [4539917834231252, 4539917834231253, 4568417834173951, 4612917834310471, 4612917834310472, 4621017834345271, 4621017834345272, 4621017834345273, 4624017834145772, 4624017834145773, 4739117834121452, 4774217833501731, 4806217834128941, 4806217834128942, 4835317834125091, 4850117834324641, 4850117834324642, 4876317834223641, 4876317834223642, 4876317834223643, 4726517834144732, 4726517834144733, 4739117834121451, 4739117834121452, 4739117834121453, 4774217833501731, 4774217833501732, 4774217833501733, 4806217834128941, 4806217834128942, 4806217834128943, 4835317834125091, 4835317834125092, 4835317834125093, 4848517834264351, 4848517834264352, 4848517834264353, 4850117834324641, 4850117834324642, 4850917834058111, 4850917834058112, 4876317834223641, 4876317834223642, 4876317834223643, 4726517834144732, 4726517834144733, 4739117834121451, 4739117834121452, 4739117834121453, 4774217833501731, 4774217833501732, 4774217833501733, 4806217834128941, 4806217834128942, 4806217834128943, 4835317834125091, 4835317834125092, 4835317834125093, 4848517834264351, 4848517834264352, 4848517834264353, 4850117834324641, 4850117834324642, 4850917834058111, 4850917834058112, 4876317834223641, 4876317834223642, 4876317834223643, 4726517834144732, 4726517834144733, 4739117834121451, 4739117834121452, 4739117834121453, 4774217833501731, 4774217833501732, 4774217833501733, 4806217834128941, 4806217834128942, 4806217834128943, 4835317834125091, 4835317834125092, 4835317834125093, 4848517834264351, 4848517834264352, 4848517834264353, 4850117834324641, 4850117834324642, 4850917834058111, 4850917834058112, 4876317834223641, 4876317834223642, 4876317834223643, 4876317834223641, 4876317834223642, 4876317834223643,]; $alDoilea = [4621017834345273, 4621017834345272, 4621017834345271, 4850117834324642, 4850117834324641, 4874517834312491, 4612917834310473, 4612917834310472, 4612917834310471, 4848517834264353, 4848517834264352, 4848517834264351, 4539917834231253, 4539917834231252, 4539917834231251, 4876317834223643, 4876317834223642, 4876317834223641, 4543617834202712, 4543617834202711, 4568417834173953, 4568417834173952, 4568417834173951, 4624017834145773, 4624017834145772, 4624017834145771, 4726517834144733, 4726517834144732, 4726517834144731, 4806217834128943, 4806217834128942, 4806217834128941, 4835317834125093, 4835317834125092, 4835317834125091, 4739117834121453, 4739117834121452, 4739117834121451, 4627517834116003, 4627517834116002, 4627517834116001, 4850917834058112, 4850917834058111, 4774217833501733, 4774217833501732, 4774217833501731,] ; // normalizează (dacă vin cu spații sau ca numere) $normalize = static function (array $items): array { return array_values(array_unique(array_map(static function ($value) { return preg_replace('/\s+/', '', (string) $value); }, $items))); }; $primul = $normalize($primul); $alDoilea = $normalize($alDoilea); $gasite = array_values(array_intersect($alDoilea, $primul)); $negasite = array_values(array_diff($alDoilea, $primul)); echo 'Total in al doilea: ' . count($alDoilea) . PHP_EOL; echo 'Gasite in primul: ' . count($gasite) . PHP_EOL; echo 'Negasite in primul: ' . count($negasite) . PHP_EOL; echo PHP_EOL . 'Gasite:' . PHP_EOL; print_r($gasite); echo PHP_EOL . 'Negasite:' . PHP_EOL; print_r($negasite);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsPmL
function name:  (null)
number of ops:  49
compiled vars:  !0 = $primul, !1 = $alDoilea, !2 = $normalize, !3 = $gasite, !4 = $negasite
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   97     1        ASSIGN                                                       !1, <array>
  146     2        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
          3        ASSIGN                                                       !2, ~7
  151     4        INIT_DYNAMIC_CALL                                            !2
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $9      
          7        ASSIGN                                                       !0, $9
  152     8        INIT_DYNAMIC_CALL                                            !2
          9        SEND_VAR_EX                                                  !1
         10        DO_FCALL                                          0  $11     
         11        ASSIGN                                                       !1, $11
  153    12        INIT_FCALL                                                   'array_values'
         13        INIT_FCALL                                                   'array_intersect'
         14        SEND_VAR                                                     !1
         15        SEND_VAR                                                     !0
         16        DO_ICALL                                             $13     
         17        SEND_VAR                                                     $13
         18        DO_ICALL                                             $14     
         19        ASSIGN                                                       !3, $14
  154    20        INIT_FCALL                                                   'array_values'
         21        INIT_FCALL                                                   'array_diff'
         22        SEND_VAR                                                     !1
         23        SEND_VAR                                                     !0
         24        DO_ICALL                                             $16     
         25        SEND_VAR                                                     $16
         26        DO_ICALL                                             $17     
         27        ASSIGN                                                       !4, $17
  155    28        COUNT                                                ~19     !1
         29        CONCAT                                               ~20     'Total+in+al+doilea%3A+', ~19
         30        CONCAT                                               ~21     ~20, '%0A'
         31        ECHO                                                         ~21
  156    32        COUNT                                                ~22     !3
         33        CONCAT                                               ~23     'Gasite+in+primul%3A+', ~22
         34        CONCAT                                               ~24     ~23, '%0A'
         35        ECHO                                                         ~24
  157    36        COUNT                                                ~25     !4
         37        CONCAT                                               ~26     'Negasite+in+primul%3A+', ~25
         38        CONCAT                                               ~27     ~26, '%0A'
         39        ECHO                                                         ~27
  158    40        ECHO                                                         '%0AGasite%3A%0A'
  159    41        INIT_FCALL                                                   'print_r'
         42        SEND_VAR                                                     !3
         43        DO_ICALL                                                     
  160    44        ECHO                                                         '%0ANegasite%3A%0A'
  161    45        INIT_FCALL                                                   'print_r'
         46        SEND_VAR                                                     !4
         47        DO_ICALL                                                     
         48      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsPmL
function name:  {closure:/in/lsPmL:146}
number of ops:  16
compiled vars:  !0 = $items
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  146     0  E >   RECV                                                 !0      
  147     1        INIT_FCALL                                                   'array_values'
          2        INIT_FCALL                                                   'array_unique'
          3        INIT_FCALL                                                   'array_map'
          4        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
  149     5        SEND_VAL                                                     ~1
          6        SEND_VAR                                                     !0
  147     7        DO_ICALL                                             $2      
  149     8        SEND_VAR                                                     $2
  147     9        DO_ICALL                                             $3      
  149    10        SEND_VAR                                                     $3
  147    11        DO_ICALL                                             $4      
  149    12        VERIFY_RETURN_TYPE                                           $4
         13      > RETURN                                                       $4
  150    14*       VERIFY_RETURN_TYPE                                           
         15*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lsPmL
function name:  {closure:{closure:/in/lsPmL:146}:147}
number of ops:  6
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  147     0  E >   RECV                                                 !0      
  148     1        CAST                                              6  ~1      !0
          2        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F%5Cs%2B%2F', ''
          3        OP_DATA                                                      ~1
          4      > RETURN                                                       ~2
  149     5*     > RETURN                                                       null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
176.77 ms | 1499 KiB | 19 Q