# nikic/scalar_objects

Extension that adds support for method calls on primitive types in PHP

Repository: https://github.com/nikic/scalar_objects
Canonical: https://ross.abutalabs.com/products/scalar_objects
Language: PHP
License: MIT
License Family: permissive
Last push: 2025-08-10T14:09:34+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 36, release rhythm 35, longevity 100
- inputs: {"age_days": 4968, "days_push": 388, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1143, forks 44 (observed 2026-08-28T04:03:45.019203+00:00)

## What it is
A PHP C extension that enables method calls on primitive types like strings and arrays, e.g. $str->length(). It serves as a proof-of-concept for prototyping redesigned primitive APIs that could be proposed for inclusion in PHP core.

## Use cases
- call methods directly on strings and arrays in PHP
- prototype new PHP primitive type APIs in userland
- design consistent APIs to propose for PHP core
- replace inconsistent PHP string and array functions with object syntax

## When to choose
- you are designing or prototyping new PHP core APIs for primitive types
- you want to experiment with object-style syntax on scalars in PHP 7.0-8.1

## When to avoid
- you need production-ready code, since this is a proof of concept
- you use the PHP JIT compiler, which is incompatible
- you need PHP 8.2+ support

## Facets
- artifact type: library
- maturity: experimental
- function: programming-language, developer-tools
- domain: programming-languages, developer-tools
- platform: php, windows
- tags: php-extension, primitive-types, method-calls, proof-of-concept, api-design, linux, macos

## Member repositories
- nikic/scalar_objects (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:45.019203+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:34:56.657487+00:00, confidence not recorded.
  - readme: https://github.com/nikic/scalar_objects (fetched 2026-08-28T04:03:45.019203+00:00, sha d236252c2f11)
- Data as of 2026-08-30T08:39:29.467469+00:00.
