note 6848 modified in control-structures.switch by vrana

From: Date: Tue, 17 Aug 2004 13:55:06 +0000
Subject: note 6848 modified in control-structures.switch by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79763@lists.php.net to get a copy of this message
Just my 2 bits. Now that PHP4 supports variable function arguments, based on example 2 you should be able to assign vars like this: <?php switch (func_num_args()){ case 3: $arg2 = func_get_arg(2); case 2: $arg1 = func_get_arg(1); case 1: $arg0 = func_get_arg(0); break; } ?> --was-- Just my 2 bits. Now that PHP4 supports variable function arguments, based on example 2 you should be able to assign vars like this: switch (func_num_args()){ case 3: $arg2 = func_get_arg(2); case 2: $arg1 = func_get_arg(1); case 1: $arg0 = func_get_arg(0); break; } http://php.net/manual/en/control-structures.switch.php

« previous php.notes (#79763) next »