php / php/php-src

Regression in 8.5: float values are treated as invalid when updating LDAP values

オープン
#22,108 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@Girgias がすでに取り組んでいます。

2026年5月21日 から。

Bug Extension: ldap Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following code:

<?php
ldap_modify($ds, $dn, ['shadowlastchange' => round(time() / (24*3600))]);

Resulted in this output:

LDAP value must be of type string|int|bool, float given (0)

But I expected this output instead:

no output, the operation succeeded before

Problem is caused by php_ldap_try_get_ldap_value_from_zval and used by he following commit: https://github.com/php/php-src/commit/636b6a1a59efe655a17e9a4a2d67865b53babe0c

I can obviously now cast all these kind of timestamp calculations with round(...) to int: (int)round(...), but this is existing code which worked for 10+ years.

So the question is: was that BC breach intended, or does it make sense to handle that cast to int automatically in php_ldap_try_get_ldap_value_from_zval?

Ralf

PHP Version
PHP 8.5.5 (cli) (built: Apr 11 2026 06:53:07) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.5.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.5, Copyright (c), by Zend Technologies
Operating System

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。