[PHP-CVS] svn: /php/php-src/trunk/ext/interbase/ interbase.rc

2010-05-21 Thread Kalle Sommer Nielsen
kalleFri, 21 May 2010 09:01:00 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299569

Log:
Remove this RC file, it should be named template.rc anyway and the default 
template.rc already covers what this .rc file did

Changed paths:
D   php/php-src/trunk/ext/interbase/interbase.rc

Deleted: php/php-src/trunk/ext/interbase/interbase.rc
===
--- php/php-src/trunk/ext/interbase/interbase.rc2010-05-21 08:21:27 UTC 
(rev 299568)
+++ php/php-src/trunk/ext/interbase/interbase.rc2010-05-21 09:01:00 UTC 
(rev 299569)
@@ -1,81 +0,0 @@
-/*
-   +--+
-   | PHP Version 5|
-   +--+
-   | Copyright (c) 1997-2010 The PHP Group|
-   +--+
-   | This source file is subject to version 3.01 of the PHP license,  |
-   | that is bundled with this package in the file LICENSE, and is|
-   | available through the world-wide-web at the following url:   |
-   | http://www.php.net/license/3_01.txt  |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to  |
-   | [email protected] so we can mail you a copy immediately.   |
-   +--+
-   | Author:  Ard Biesheuvel   |
-   +--+
- */
-
-/* $Id$ */
-
-#ifdef APSTUDIO_INVOKED
-#error This file cannot be opened from the Visual Studio IDE
-#endif
-
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-#include "winres.h"
-#undef APSTUDIO_READONLY_SYMBOLS
-
-#include "php_version.h"
-
-#ifdef _DEBUG
-# define BUILD_TYPE "Debug"
-#else
-# define BUILD_TYPE "Release"
-#endif
-
-#include 
-#include "interbase.c"
-
-#ifdef FB_SQLDA
-#define CLIENT_LIB "fbclient.dll"
-#else
-#define CLIENT_LIB "gds32.dll"
-#endif
-
-#ifndef _MAC
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
- PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
-#ifndef _DEBUG
- FILEFLAGS 0x0L
-#else
- FILEFLAGS 0x1L
-#endif
- FILEFLAGSMASK 0x3fL
- FILEOS VOS__WINDOWS32
- FILETYPE VFT_DLL
- FILESUBTYPE VFT2_UNKNOWN
-BEGIN
-BLOCK "StringFileInfo"
-BEGIN
-BLOCK "04b0"
-BEGIN
-VALUE "FileDescription", "PHP Interbase module\0"
-VALUE "FileVersion", PHP_VERSION "\0"
-VALUE "LegalCopyright", "Copyright � 2010 The PHP Group\0"
-   VALUE "Build Type", BUILD_TYPE "\0"
-VALUE "Client Library", CLIENT_LIB "\0"
-   VALUE "URL", "http://www.php.net/\0";
-END
-END
-BLOCK "VarFileInfo"
-BEGIN
-VALUE "Translation", 0x0, 1200
-END
-END
-
-#endif// !_MAC

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c trunk/ext/pdo_mysql/mysql_statement.c

2010-05-21 Thread Andrey Hristov
andrey   Fri, 21 May 2010 11:09:28 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299574

Log:
Fix for Bug #51870
PDO::fetchAll after a PDO::execute with bindings lead to a segv.

It is only in unreleased code and thus doesn't deserve a NEWS entry

Bug: http://bugs.php.net/51870 (Open) PDO::fetchAll after a PDO::execute with 
bindings lead to a segv.
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
U   php/php-src/trunk/ext/pdo_mysql/mysql_statement.c

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
2010-05-21 11:09:17 UTC (rev 299573)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
2010-05-21 11:09:28 UTC (rev 299574)
@@ -111,7 +111,7 @@
 #endif /* HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND */
 #if PDO_USE_MYSQLND
if (!S->stmt && S->current_data) {
-   free(S->current_data);
+   mnd_free(S->current_data);
}
 #endif /* PDO_USE_MYSQLND */

@@ -652,7 +652,7 @@
}
 #if PDO_USE_MYSQLND
if (!S->stmt && S->current_data) {
-   free(S->current_data);
+   mnd_free(S->current_data);
}
 #endif /* PDO_USE_MYSQLND */


Modified: php/php-src/trunk/ext/pdo_mysql/mysql_statement.c
===
--- php/php-src/trunk/ext/pdo_mysql/mysql_statement.c   2010-05-21 11:09:17 UTC 
(rev 299573)
+++ php/php-src/trunk/ext/pdo_mysql/mysql_statement.c   2010-05-21 11:09:28 UTC 
(rev 299574)
@@ -111,7 +111,7 @@
 #endif /* HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND */
 #if PDO_USE_MYSQLND
if (!S->stmt && S->current_data) {
-   free(S->current_data);
+   mnd_free(S->current_data);
}
 #endif /* PDO_USE_MYSQLND */

@@ -652,7 +652,7 @@
}
 #if PDO_USE_MYSQLND
if (!S->stmt && S->current_data) {
-   free(S->current_data);
+   mnd_free(S->current_data);
}
 #endif /* PDO_USE_MYSQLND */


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c trunk/ext/mysqlnd/mysqlnd_debug.c

2010-05-21 Thread Andrey Hristov
andrey   Fri, 21 May 2010 13:06:52 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299578

Log:
When OOM hits the wire, don't crash.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-05-21 
12:16:07 UTC (rev 299577)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c2010-05-21 
13:06:52 UTC (rev 299578)
@@ -1,4 +1,4 @@
-;/*
+/*
   +--+
   | PHP Version 5|
   +--+
@@ -679,7 +679,7 @@

DBG_INF_FMT("size=%lu ptr=%p", size, ret);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_EMALLOC_COUNT, 
1, STAT_MEM_EMALLOC_AMOUNT, size);
}
@@ -711,7 +711,7 @@

DBG_INF_FMT("size=%lu ptr=%p persistent=%d", size, ret, persistent);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? 
STAT_MEM_MALLOC_COUNT:STAT_MEM_EMALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? 
STAT_MEM_MALLOC_AMOUNT:STAT_MEM_EMALLOC_AMOUNT;
*(size_t *) ret = size;
@@ -747,7 +747,7 @@

DBG_INF_FMT("after : %lu", zend_memory_usage(FALSE TSRMLS_CC));
DBG_INF_FMT("size=%lu ptr=%p", size, ret);
-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_ECALLOC_COUNT, 
1, STAT_MEM_ECALLOC_AMOUNT, size);
}
@@ -779,7 +779,7 @@

DBG_INF_FMT("size=%lu ptr=%p", size, ret);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? 
STAT_MEM_CALLOC_COUNT:STAT_MEM_ECALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? 
STAT_MEM_CALLOC_AMOUNT:STAT_MEM_ECALLOC_AMOUNT;
*(size_t *) ret = size;
@@ -815,7 +815,7 @@
 #endif

DBG_INF_FMT("new_ptr=%p", (char*)ret);
-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
*(size_t *) ret = new_size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_EREALLOC_COUNT, 
1, STAT_MEM_EREALLOC_AMOUNT, new_size);
}
@@ -849,7 +849,7 @@

DBG_INF_FMT("new_ptr=%p", (char*)ret);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? 
STAT_MEM_REALLOC_COUNT:STAT_MEM_EREALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? 
STAT_MEM_REALLOC_AMOUNT:STAT_MEM_EREALLOC_AMOUNT;
*(size_t *) ret = new_size;

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c   2010-05-21 12:16:07 UTC 
(rev 299577)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c   2010-05-21 13:06:52 UTC 
(rev 299578)
@@ -1,4 +1,4 @@
-;/*
+/*
   +--+
   | PHP Version 5|
   +--+
@@ -679,7 +679,7 @@

DBG_INF_FMT("size=%lu ptr=%p", size, ret);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_EMALLOC_COUNT, 
1, STAT_MEM_EMALLOC_AMOUNT, size);
}
@@ -711,7 +711,7 @@

DBG_INF_FMT("size=%lu ptr=%p persistent=%d", size, ret, persistent);

-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
enum mysqlnd_collected_stats s1 = persistent? 
STAT_MEM_MALLOC_COUNT:STAT_MEM_EMALLOC_COUNT;
enum mysqlnd_collected_stats s2 = persistent? 
STAT_MEM_MALLOC_AMOUNT:STAT_MEM_EMALLOC_AMOUNT;
*(size_t *) ret = size;
@@ -747,7 +747,7 @@

DBG_INF_FMT("after : %lu", zend_memory_usage(FALSE TSRMLS_CC));
DBG_INF_FMT("size=%lu ptr=%p", size, ret);
-   if (collect_memory_statistics) {
+   if (ret && collect_memory_statistics) {
*(size_t *) ret = size;
MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_MEM_ECALLOC_COUNT, 
1, STAT_MEM_ECALLOC_AMOUNT, size);
   

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c trunk/ext/mysqlnd/mysqlnd_result.c

2010-05-21 Thread Andrey Hristov
andrey   Fri, 21 May 2010 13:37:18 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299579

Log:
Check set->data for validity before using it.
Prevents crashes after OOM.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-21 
13:06:52 UTC (rev 299578)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c   2010-05-21 
13:37:18 UTC (rev 299579)
@@ -186,34 +186,37 @@
DBG_ENTER("mysqlnd_res::free_buffered_data");
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);

-   DBG_INF_FMT("before: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE 
TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
-   for (row = set->row_count - 1; row >= 0; row--) {
-   zval **current_row = set->data + row * field_count;
-   MYSQLND_MEMORY_POOL_CHUNK *current_buffer = 
set->row_buffers[row];
-   int col;
+   DBG_INF("Freeing data & row_buffer");
+   if (set->data) {

-   for (col = field_count - 1; col >= 0; --col) {
-   zend_bool copy_ctor_called;
-   if (current_row[0] == NULL) {
-   break;/* row that was never initialized */
-   }
+   DBG_INF_FMT("before: real_usage=%lu  usage=%lu", 
zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
+   for (row = set->row_count - 1; row >= 0; row--) {
+   zval **current_row = set->data + row * field_count;
+   MYSQLND_MEMORY_POOL_CHUNK *current_buffer = 
set->row_buffers[row];
+   int col;
+
+   for (col = field_count - 1; col >= 0; --col) {
+   zend_bool copy_ctor_called;
+   if (current_row == NULL || current_row[0] == 
NULL) {
+   break;/* row that was never initialized 
*/
+   }
mysqlnd_palloc_zval_ptr_dtor(&(current_row[col]), 
result->type, ©_ctor_called TSRMLS_CC);
 #if MYSQLND_DEBUG_MEMORY
-   DBG_INF_FMT("Copy_ctor_called=%d", copy_ctor_called);
+   DBG_INF_FMT("Copy_ctor_called=%d", 
copy_ctor_called);
 #endif
-   MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? 
STAT_COPY_ON_WRITE_PERFORMED:
+   MYSQLND_INC_GLOBAL_STATISTIC(copy_ctor_called? 
STAT_COPY_ON_WRITE_PERFORMED:

   STAT_COPY_ON_WRITE_SAVED);
-   }
+   }
 #if MYSQLND_DEBUG_MEMORY
-   DBG_INF("Freeing current_row & current_buffer");
+   DBG_INF("Freeing current_row & current_buffer");
 #endif
-   current_buffer->free_chunk(current_buffer TSRMLS_CC);
-   }
-   DBG_INF("Freeing data & row_buffer");
-   if (set->data) {
+   current_buffer->free_chunk(current_buffer TSRMLS_CC);
+   }
+
mnd_pefree(set->data, set->persistent);
set->data = NULL;
}
+
if (set->row_buffers) {
mnd_pefree(set->row_buffers, set->persistent);
set->row_buffers= NULL;

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-21 13:06:52 UTC 
(rev 299578)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c  2010-05-21 13:37:18 UTC 
(rev 299579)
@@ -186,34 +186,37 @@
DBG_ENTER("mysqlnd_res::free_buffered_data");
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);

-   DBG_INF_FMT("before: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE 
TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
-   for (row = set->row_count - 1; row >= 0; row--) {
-   zval **current_row = set->data + row * field_count;
-   MYSQLND_MEMORY_POOL_CHUNK *current_buffer = 
set->row_buffers[row];
-   int col;
+   DBG_INF("Freeing data & row_buffer");
+   if (set->data) {

-   for (col = field_count - 1; col >= 0; --col) {
-   zend_bool copy_ctor_called;
-   if (current_row[0] == NULL) {
-   break;/* row that was never initialized */
-   }
+   DBG_INF_FMT("before: real_usage=%lu  usage=%lu", 
zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
+   

[PHP-CVS] svn: /SVNROOT/ global_avail

2010-05-21 Thread Philip Olson
philip   Fri, 21 May 2010 19:43:22 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299597

Log:
- phpdoc/de karma for Raphael Michel (raphaelm)

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2010-05-21 19:25:59 UTC (rev 299596)
+++ SVNROOT/global_avail2010-05-21 19:43:22 UTC (rev 299597)
@@ -73,7 +73,7 @@
 
avail|noihex,mfalgas,ereza,ebi,ait,jabro,eduardcapell,oriolm,yagooar,jeprubio,marctm|phpdoc/ca
 avail|mkoula|phpdoc/cs
 avail|penguin,tkxs|phpdoc/da
-avail|kore,thorstenr,lapistano|phpdoc/de
+avail|kore,thorstenr,lapistano,raphaelm|phpdoc/de
 
avail|mgonzalezle,ianasa,gustavo,soywiz,ladderalice,ideados,fcaroberga,dulasoft,benjamin,argosback,tatai,jesusruiz,jpberdejo,lduran,sabathorn,julionc,jorgeeolayap,x1v4nx,jesus_cova,edwincartagenah|phpdoc/es
 avail|parstic|phpdoc/fa
 avail|magidev,mikaelkael,jpauli|phpdoc/fr

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/json/JSON_parser.c ext/json/JSON_parser.h ext/json/json.c ext/json/php_json.h ext/json/tests/008.phpt ext/json/tests/json_decode_error.phpt

2010-05-21 Thread Sara Golemon
pollita  Fri, 21 May 2010 22:59:58 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299605

Log:
Add JSON_BIGINT_AS_STRING for json_decode() to parse large numbers
as strings rather than casting to double and loosing precision.

Changed paths:
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/json/JSON_parser.c
U   php/php-src/trunk/ext/json/JSON_parser.h
U   php/php-src/trunk/ext/json/json.c
U   php/php-src/trunk/ext/json/php_json.h
A   php/php-src/trunk/ext/json/tests/008.phpt
U   php/php-src/trunk/ext/json/tests/json_decode_error.phpt

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS	2010-05-21 22:55:18 UTC (rev 299604)
+++ php/php-src/trunk/NEWS	2010-05-21 22:59:58 UTC (rev 299605)
@@ -31,6 +31,7 @@
 - Added closure $this support back. (Stas)
 - Added SplObjectStorage::getHash() hook. (Etienne)
 - Added JsonSerializable interface (Sara)
+- Added JSON_BIGINT_AS_STRING, extended json_decode() sig with $options. (Sara)
 - Added support for storing upload progress feedback in session data. (Arnaud)
 - Added support for CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE.
   FR #51815. (Pierrick)

Modified: php/php-src/trunk/ext/json/JSON_parser.c
===
--- php/php-src/trunk/ext/json/JSON_parser.c	2010-05-21 22:55:18 UTC (rev 299604)
+++ php/php-src/trunk/ext/json/JSON_parser.c	2010-05-21 22:59:58 UTC (rev 299605)
@@ -291,12 +291,14 @@
 }


-static void json_create_zval(zval **z, smart_str *buf, int type)
+static void json_create_zval(zval **z, smart_str *buf, int type, int options)
 {
 ALLOC_INIT_ZVAL(*z);

 if (type == IS_LONG)
 {
+		zend_bool bigint = 0;
+
 		if (buf->c[0] == '-') {
 			buf->len--;
 		}
@@ -306,9 +308,22 @@
 int cmp = strcmp(buf->c + (buf->c[0] == '-'), long_min_digits);

 if (!(cmp < 0 || (cmp == 0 && buf->c[0] == '-'))) {
-	goto use_double;
+	bigint = 1;
 }
 			} else {
+bigint = 1;
+			}
+		}
+
+		if (bigint) {
+			/* value too large to represent as a long */
+			if (options & PHP_JSON_BIGINT_AS_STRING) {
+if (buf->c[0] == '-') {
+	/* Restore last char consumed above */
+	buf->len++;
+}
+goto use_string;
+			} else {
 goto use_double;
 			}
 		}
@@ -322,6 +337,7 @@
 }
 else if (type == IS_STRING)
 {
+use_string:
 ZVAL_STRINGL(*z, buf->c, buf->len, 1);
 }
 else if (type == IS_BOOL)
@@ -420,12 +436,13 @@
 machine with a stack.
 */
 int
-parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC)
+parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC)
 {
 int next_char;  /* the next character */
 int next_class;  /* the next character class */
 int next_state;  /* the next state */
 int the_index;
+int assoc = options & PHP_JSON_OBJECT_AS_ARRAY;

 smart_str buf = {0};
 smart_str key = {0};
@@ -530,7 +547,7 @@
 zval *mval;
 smart_str_0(&buf);

-json_create_zval(&mval, &buf, type);
+json_create_zval(&mval, &buf, type, options);

 if (!assoc) {
 add_property_zval_ex(jp->the_zstack[jp->top], (key.len ? key.c : "_empty_"), (key.len ? (key.len + 1) : sizeof("_empty_")), mval TSRMLS_CC);
@@ -558,7 +575,7 @@
 zval *mval;
 smart_str_0(&buf);

-json_create_zval(&mval, &buf, type);
+json_create_zval(&mval, &buf, type, options);
 add_next_index_zval(jp->the_zstack[jp->top], mval);
 buf.len = 0;
 JSON_RESET_TYPE();
@@ -669,7 +686,7 @@
  jp->stack[jp->top] == MODE_ARRAY))
 {
 smart_str_0(&buf);
-json_create_zval(&mval, &buf, type);
+json_create_zval(&mval, &buf, type, options);
 }

 switch (jp->stack[jp->top]) {

Modified: php/php-src/trunk/ext/json/JSON_parser.h
===
--- php/php-src/trunk/ext/json/JSON_parser.h	2010-05-21 22:55:18 UTC (rev 299604)
+++ php/php-src/trunk/ext/json/JSON_parser.h	2010-05-21 22:59:58 UTC (rev 299605)
@@ -5,6 +5,7 @@

 #include "php.h"
 #include "ext/standard/php_smart_str.h"
+#include "php_json.h"

 #define JSON_PARSER_DEFAULT_DEPTH 512

@@ -28,6 +29,12 @@
 };

 extern JSON_parser new_JSON_parser(int depth);
-extern int parse_JSON(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int assoc TSRMLS_DC);
+extern int parse_JSON_ex(JSON_parser jp, zval *z, unsigned short utf16_json[], int length, int options TSRMLS_DC);
 extern int free_JSON_parser(JSON_parser jp);
+
+static inline int p

[PHP-CVS] svn: /php/php-src/trunk/ext/json/ JSON_parser.h php_json.h

2010-05-21 Thread Sara Golemon
pollita  Fri, 21 May 2010 23:29:34 +

Revision: http://svn.php.net/viewvc?view=revision&revision=299606

Log:
Ooops, return values...

Changed paths:
U   php/php-src/trunk/ext/json/JSON_parser.h
U   php/php-src/trunk/ext/json/php_json.h

Modified: php/php-src/trunk/ext/json/JSON_parser.h
===
--- php/php-src/trunk/ext/json/JSON_parser.h2010-05-21 22:59:58 UTC (rev 
299605)
+++ php/php-src/trunk/ext/json/JSON_parser.h2010-05-21 23:29:34 UTC (rev 
299606)
@@ -34,7 +34,7 @@

 static inline int parse_JSON(JSON_parser jp, zval *z, unsigned short 
utf16_json[], int length, int assoc TSRMLS_DC)
 {
-   parse_JSON_ex(jp, z, utf16_json, length, assoc ? 
PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC);
+   return parse_JSON_ex(jp, z, utf16_json, length, assoc ? 
PHP_JSON_OBJECT_AS_ARRAY : 0 TSRMLS_CC);
 }

 #endif

Modified: php/php-src/trunk/ext/json/php_json.h
===
--- php/php-src/trunk/ext/json/php_json.h   2010-05-21 22:59:58 UTC (rev 
299605)
+++ php/php-src/trunk/ext/json/php_json.h   2010-05-21 23:29:34 UTC (rev 
299606)
@@ -68,7 +68,7 @@
 #define PHP_JSON_OBJECT_AS_ARRAY   (1<<0)
 #define PHP_JSON_BIGINT_AS_STRING  (1<<1)

-static inline php_json_decode(zval *return_value, char *str, int str_len, 
zend_bool assoc, long depth TSRMLS_DC)
+static inline void php_json_decode(zval *return_value, char *str, int str_len, 
zend_bool assoc, long depth TSRMLS_DC)
 {
php_json_decode_ex(return_value, str, str_len, assoc ? 
PHP_JSON_OBJECT_AS_ARRAY : 0, depth TSRMLS_CC);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/tests/array_type_hint_001.phpt Zend/tests/hint/param_type_hint_001.phpt Zend/tests/hint/param_type_hint_002.phpt Zend/tests/hint/param_type_hint_003.

2010-05-21 Thread Felipe Pena
Hi,

2010/5/20 Derick Rethans 

> derick   Thu, 20 May 2010 19:18:35 +


> Revision: http://svn.php.net/viewvc?view=revision&revision=299534
>
> Log:
> - Added scalar typehinting.
>
> Changed paths:
> 
>
>
>
Any reason to not do the same as array is treated nowadays? e.g.

"object" {
return T_OBJECT;
}

I'm asking because the type names are surely intended to be reserved words
from now.

Using: ("string"|"binary"){TABS_AND_SPACES}[ \t&]+"$" { is
confusing because we might to create the String/binary class in PHP and when
trying to use it as type-hint it will ask for the php type, not the class...
obviously. Which represent a BC independentely of 'string' not being a
reserved word. (If was this the reason for the token rules just to match
arguments)

And just to informe, the source as is, we have the following issues:
foo(string$var) -> expect an string class instance
foo(string $var) -> expect a php string type

It need be like: ("string"|"binary"){WHITESPACE}*("&"{WHITESPACE}*)?"$", but
I think it shouldn't be a argument specific rule, but the same as T_ARRAY
is.


Patch to make string, real, binary, etc... reserved words:
http://dpaste.org/00Le/raw/

If no objections, I'll commit it, alright? :)

-- 
Regards,
Felipe Pena