php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch PHP_trunk_spl_switch_cleanup.patch for SPL related Bug #60596

Patch version 2011-12-22 20:15 UTC

Return to Bug #60596 | Download this patch
Patch Revisions:

Developer: ircmaxell

Index: ext/spl/spl_engine.c
===================================================================
--- ext/spl/spl_engine.c	(revision 321340)
+++ ext/spl/spl_engine.c	(working copy)
@@ -50,14 +50,11 @@
 		ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, idx);
 		break;
 	case IS_DOUBLE:
+		return (long)Z_DVAL_P(offset);
 	case IS_RESOURCE:
 	case IS_BOOL:
 	case IS_LONG:
-		if (Z_TYPE_P(offset) == IS_DOUBLE) {
-			return (long)Z_DVAL_P(offset);
-		} else {
-			return Z_LVAL_P(offset);
-		}
+		return Z_LVAL_P(offset);
 	}
 	return -1;
 } 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 06:01:29 2024 UTC