3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var1= ""; $var2= ""; $var3= "3"; $temp_array = array($var1,$var2,$var3); $temp_count =count(array_filter($temp_array)); if($temp_count ==1){ echo "1 variable is not empty"; } else { echo "total variable is = ".$temp_count; }

preferences:
47.81 ms | 402 KiB | 5 Q