Skip to content

Commit

Permalink
Merge pull request #2236 from zephir-lang/development
Browse files Browse the repository at this point in the history
0.13.4
  • Loading branch information
AlexNDRmac authored Apr 26, 2021
2 parents f18f285 + 8d3141c commit 1218434
Show file tree
Hide file tree
Showing 27 changed files with 289 additions and 46 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org).
## [Unreleased]


## [0.13.4] - 2021-04-26
### Fixed
- Fixed cast string from null [#2232](https://github.com/zephir-lang/zephir/issues/2232)
- Fixed strict nullable string type when `null` is passed [#2234](https://github.com/zephir-lang/zephir/issues/2234)


## [0.13.3] - 2021-04-25
### Fixed
- Fixed nullable array [#1094](https://github.com/zephir-lang/zephir/issues/1094)
Expand Down Expand Up @@ -465,7 +471,8 @@ and this project adheres to [Semantic Versioning](http://semver.org).
- Fixed casting resource to int (only ZendEngine 3)
[#1524](https://github.com/zephir-lang/zephir/issues/1524)

[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.13.3...HEAD
[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.13.4...HEAD
[0.13.4]: https://github.com/zephir-lang/zephir/compare/0.13.3...0.13.4
[0.13.3]: https://github.com/zephir-lang/zephir/compare/0.13.2...0.13.3
[0.13.2]: https://github.com/zephir-lang/zephir/compare/0.13.1...0.13.2
[0.13.1]: https://github.com/zephir-lang/zephir/compare/0.13.0...0.13.1
Expand Down
1 change: 0 additions & 1 deletion Library/Backends/ZendEngine2/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,6 @@ public function checkStrictType($type, $var, CompilationContext $context)
$codePrinter->output('} else {');
$codePrinter->increaseLevel();
$this->initVar($inputParamVariable, $context);
$codePrinter->output('ZVAL_EMPTY_STRING('.$inputParamCode.');');
$codePrinter->decreaseLevel();
$codePrinter->output('}');
break;
Expand Down
6 changes: 4 additions & 2 deletions Library/Operators/Other/CastOperator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace Zephir\Operators\Other;

use Zephir\CompilationContext;
Expand All @@ -22,7 +24,7 @@
use Zephir\Types;

/**
* Cast.
* Cast operator
*
* Converts a value into another of a different type
*/
Expand Down Expand Up @@ -527,7 +529,7 @@ public function compile(array $expression, CompilationContext $compilationContex
$resolvedCode = $compilationContext->backend->getVariableCode($resolvedVariable);

$compilationContext->codePrinter->output(
sprintf('zephir_get_strval(%s, %s);', $symbol, $resolvedCode)
sprintf('zephir_cast_to_string(%s, %s);', $symbol, $resolvedCode)
);

if ($symbolVariable->isTemporal()) {
Expand Down
2 changes: 1 addition & 1 deletion Library/Zephir.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
final class Zephir
{
const VERSION = '0.13.3-$Id$';
const VERSION = '0.13.4-$Id$';

const LOGO = <<<'ASCII'
_____ __ _
Expand Down
21 changes: 21 additions & 0 deletions ext/kernel/operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,27 @@ long zephir_safe_mod_double_zval(double op1, zval *op2);
} \
}

/**
* This is previous version of zephir_get_strval()
*
* TODO: Find more native solution to cast a string
*/
#define zephir_cast_to_string(left, right) \
{ \
int use_copy_right; \
zval right_tmp; \
if (Z_TYPE_P(right) == IS_STRING) { \
ZEPHIR_CPY_WRT(left, right); \
} else { \
use_copy_right = zephir_make_printable_zval(right, &right_tmp); \
if (use_copy_right) { \
ZEPHIR_INIT_NVAR(left); \
ZVAL_STRINGL(left, Z_STRVAL(right_tmp), Z_STRLEN(right_tmp)); \
zval_ptr_dtor(&right_tmp); \
} \
} \
}

/**
* TODO: Re-visit IS_NULL check, when ZEND_PARSE_PARAMETERS_* will be in better condition in Zephir
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/php_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define PHP_STUB_VERSION "1.0.0"
#define PHP_STUB_EXTNAME "stub"
#define PHP_STUB_AUTHOR "Phalcon Team and contributors"
#define PHP_STUB_ZEPVERSION "0.13.3-$Id$"
#define PHP_STUB_ZEPVERSION "0.13.4-$Id$"
#define PHP_STUB_DESCRIPTION "Description <b>test</b> for<br/>Test Extension."

typedef struct _zephir_struct_db {
Expand Down
2 changes: 0 additions & 2 deletions ext/stub/arrayaccesstest.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 30 additions & 8 deletions ext/stub/cast.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ext/stub/cast.zep.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/compare.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/exception.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/mcall.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions ext/stub/oo/dynamicprop.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/oo/oodestruct.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/oo/ooparams.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext/stub/properties/propertyarray.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/stub/requires.zep.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1218434

Please sign in to comment.