<?php

// Dependency: OpenSSL library (or a suitable third-party library)

$ciphertext = hex2bin("CACDEC6C5455EE52BB1DA40470963113"); // Replace with your hex-encoded ciphertext
$key = hex2bin(str_repeat("\x00", 16)); // Null key (16 bytes of "\x00")
$iv = hex2bin(str_repeat("\x00", 16)); // Initialization vector (16 bytes of "\x00")

// Use OpenSSL functions (assuming OpenSSL is available)
$decrypted = openssl_decrypt($ciphertext, 'aes-128-cbc', $key, OPENSSL_RAW_DATA, $iv);

// Extract counter (assuming the counter is at the same position as the Python code)
$counter = unpack("C3", substr($decrypted, 8, 3))[1]; // Extract 3 bytes from index 8 and unpack as unsigned chars

echo $counter;

?>