1--TEST-- 2exec, system, passthru — Basic command execution functions 3--SKIPIF-- 4<?php 5// If this does not work for Windows, please uncomment or fix test 6// if(substr(PHP_OS, 0, 3) == "WIN") die("skip not for Windows"); 7?> 8--FILE-- 9<?php 10$cmd = "echo abc\n\0command"; 11try { 12 var_dump(exec($cmd, $output)); 13} catch (\ValueError $e) { 14 echo $e->getMessage() . \PHP_EOL; 15} 16try { 17 var_dump(system($cmd, $output)); 18} catch (\ValueError $e) { 19 echo $e->getMessage() . \PHP_EOL; 20} 21try { 22 var_dump(passthru($cmd, $output)); 23} catch (\ValueError $e) { 24 echo $e->getMessage() . \PHP_EOL; 25} 26?> 27--EXPECT-- 28exec(): Argument #1 ($command) must not contain any null bytes 29system(): Argument #1 ($command) must not contain any null bytes 30passthru(): Argument #1 ($command) must not contain any null bytes 31