# Dead code [PATCH]

- Thread: https://externals.io/message/45418
- Original archive: https://news-web.php.net/php.internals/45418
- Started by Patrick ALLAERT on 2009-08-27T09:11:14+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45418 — Patrick ALLAERT — 2009-08-27T09:11:14+00:00

URL: https://externals.io/message/45418#45418

2009/8/25 Johannes Schlüter <johannes@schlueters.de>:
[snip]
> For 6 I assume one might remove it, especially as it doesn't know about
> IS_UNICODE.

I thought I had enough karma to do it myself.
Can someone make it in trunk then?

Index: ext/standard/math.c
===================================================================
--- ext/standard/math.c (revision 287794)
+++ ext/standard/math.c (working copy)
@@ -795,51 +795,6 @@
 }
 /* }}} */

-/* {{{ _php_math_basetolong */
-/*
- * Convert a string representation of a base(2-36) number to a long.
- */
-PHPAPI long _php_math_basetolong(zval *arg, int base)
-{
-       long num = 0, digit, onum;
-       int i;
-       char c, *s;
-
-       if (Z_TYPE_P(arg) != IS_STRING || base < 2 || base > 36) {
-               return 0;
-       }
-
-       s = Z_STRVAL_P(arg);
-
-       for (i = Z_STRLEN_P(arg); i > 0; i--) {
-               c = *s++;
-
-               digit = (c >= '0' && c <= '9') ? c - '0'
-                       : (c >= 'A' && c <= 'Z') ? c - 'A' + 10
-                       : (c >= 'a' && c <= 'z') ? c - 'a' + 10
-                       : base;
-
-               if (digit >= base) {
-                       continue;
-               }
-
-               onum = num;
-               num = num * base + digit;
-               if (num > onum)
-                       continue;
-
-               {
-                       TSRMLS_FETCH();
-
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Number '%s' is too big to fit in long", s);
-                       return LONG_MAX;
-               }
-       }
-
-       return num;
-}
-/* }}} */
-
 /* {{{ _php_math_basetozval */
 /*
  * Convert a string representation of a base(2-36) number to a zval.


-- 
Patrick Allaert
---
http://code.google.com/p/peclapm/ - Alternative PHP Monitor
