3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4"; echo checkBcc($str); function checkBcc($str, $check_sum) { $i=0; $checksum = 0; $result = false; $len = strlen($str); echo " str:".$str; $pBuf = explode($str); print_r($pBuf); for ($i = 0; $i < $len-2; $i++) { $checksum ^= $pBuf[$i]; } echo "checksum:". $checksum; if ($checksum == $check_sum) { $result = true; } return $result; } ?>
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught ArgumentCountError: Too few arguments to function checkBcc(), 1 passed in /in/lZqe7 on line 4 and exactly 2 expected in /in/lZqe7:6 Stack trace: #0 /in/lZqe7(4): checkBcc('device_id=LA140...') #1 {main} thrown in /in/lZqe7 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33
Warning: Missing argument 2 for checkBcc(), called in /in/lZqe7 on line 4 and defined in /in/lZqe7 on line 6 str:device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4 Warning: explode() expects at least 2 parameters, 1 given in /in/lZqe7 on line 13 checksum:0 Notice: Undefined variable: check_sum in /in/lZqe7 on line 21 1
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Warning: Missing argument 2 for checkBcc(), called in /in/lZqe7 on line 4 and defined in /in/lZqe7 on line 6 str:device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4 Warning: Wrong parameter count for explode() in /in/lZqe7 on line 13 checksum:0 Notice: Undefined variable: check_sum in /in/lZqe7 on line 21 1
Output for 5.0.0 - 5.0.5
Warning: Missing argument 2 for checkBcc() in /in/lZqe7 on line 6 str:device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4 Warning: Wrong parameter count for explode() in /in/lZqe7 on line 13 checksum:01
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9
Warning: Missing argument 2 for checkbcc() in /in/lZqe7 on line 6 str:device_id=LA14011269&card_number=1073741835&mpb=1000&trans_time=1429443693&sessionId=1073741835LA140112691429443693&checksum=4 Warning: Wrong parameter count for explode() in /in/lZqe7 on line 13 checksum:01

preferences:
295.47 ms | 402 KiB | 422 Q